Skip to content

Commit a43bafe

Browse files
committed
added hls dicontinuity tag when forcing fragment split
1 parent dcf37b2 commit a43bafe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hls/ngx_rtmp_hls_module.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,14 +1363,15 @@ ngx_rtmp_hls_update_fragment(ngx_rtmp_session_t *s, uint64_t ts,
13631363
ngx_rtmp_hls_app_conf_t *hacf;
13641364
ngx_rtmp_hls_frag_t *f;
13651365
ngx_msec_t ts_frag_len;
1366-
ngx_int_t same_frag, force;
1366+
ngx_int_t same_frag, force,discont;
13671367
ngx_buf_t *b;
13681368
int64_t d;
13691369

13701370
hacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_hls_module);
13711371
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_hls_module);
13721372
f = NULL;
13731373
force = 0;
1374+
discont = 1;
13741375

13751376
if (ctx->opened) {
13761377
f = ngx_rtmp_hls_get_frag(s, ctx->nfrags);
@@ -1383,6 +1384,7 @@ ngx_rtmp_hls_update_fragment(ngx_rtmp_session_t *s, uint64_t ts,
13831384

13841385
} else {
13851386
f->duration = (ts - ctx->frag_ts) / 90000.;
1387+
discont = 0;
13861388
}
13871389
}
13881390

@@ -1412,7 +1414,7 @@ ngx_rtmp_hls_update_fragment(ngx_rtmp_session_t *s, uint64_t ts,
14121414

14131415
if (boundary || force) {
14141416
ngx_rtmp_hls_close_fragment(s);
1415-
ngx_rtmp_hls_open_fragment(s, ts, !f);
1417+
ngx_rtmp_hls_open_fragment(s, ts, discont);
14161418
}
14171419

14181420
b = ctx->aframe;

0 commit comments

Comments
 (0)