Merge pull request #343 from zotanmew/patch-media-counter

Fix media sequence counter
This commit is contained in:
Sergey Dryabzhinsky 2022-02-10 18:26:34 +03:00 committed by GitHub
commit ca9fd4a380
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,6 +73,7 @@ typedef struct {
uint64_t key_id;
ngx_uint_t nfrags;
ngx_rtmp_hls_frag_t *frags; /* circular 2 * winfrags + 1 */
uint64_t mediaseq;
ngx_uint_t audio_cc;
ngx_uint_t video_cc;
@ -605,7 +606,7 @@ ngx_rtmp_hls_write_playlist(ngx_rtmp_session_t *s, int final)
"#EXT-X-VERSION:3\n"
"#EXT-X-MEDIA-SEQUENCE:%uL\n"
"#EXT-X-TARGETDURATION:%ui\n",
ctx->frag, max_frag);
ctx->mediaseq++, max_frag);
if (hacf->type == NGX_RTMP_HLS_TYPE_EVENT) {
p = ngx_slprintf(p, end, "#EXT-X-PLAYLIST-TYPE:EVENT\n");