From 5f8a96f5056c399b1c1e5e9a6025f94ee01221de Mon Sep 17 00:00:00 2001 From: z411 Date: Sun, 15 May 2022 04:32:56 -0400 Subject: [PATCH] Fix datetime not working after the first fragment --- hls/ngx_rtmp_hls_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hls/ngx_rtmp_hls_module.c b/hls/ngx_rtmp_hls_module.c index 50f8d13..ac219f3 100644 --- a/hls/ngx_rtmp_hls_module.c +++ b/hls/ngx_rtmp_hls_module.c @@ -640,7 +640,7 @@ ngx_rtmp_hls_write_playlist(ngx_rtmp_session_t *s, int final) for (i = start_i; i < (ngx_int_t)ctx->nfrags; i++) { f = ngx_rtmp_hls_get_frag(s, i); - if ((i == 0 || f->discont) && f->datetime && f->datetime->len > 0) { + if ((i == start_i || f->discont) && f->datetime && f->datetime->len > 0) { p = ngx_snprintf(buffer, sizeof(buffer), "#EXT-X-PROGRAM-DATE-TIME:"); n = ngx_write_fd(fd, buffer, p - buffer); if (n < 0) {