Fix datetime not working after the first fragment

This commit is contained in:
z411 2022-05-15 04:32:56 -04:00
parent 9102003adf
commit 5f8a96f505
No known key found for this signature in database
GPG key ID: 74A3BEEC0AF5F222

View file

@ -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) {