mirror of
https://github.com/zotanmew/nginx-rtmp-module.git
synced 2024-05-21 18:11:08 +02:00
Correctly set media sequence number
https://datatracker.ietf.org/doc/html/rfc8216#section-4.3.3.2 specifies the media sequence number to be the number of the *first* fragment in the list, not the last one.
This commit is contained in:
parent
cfb277dea7
commit
a5f44b6d54
|
@ -73,7 +73,6 @@ typedef struct {
|
||||||
uint64_t key_id;
|
uint64_t key_id;
|
||||||
ngx_uint_t nfrags;
|
ngx_uint_t nfrags;
|
||||||
ngx_rtmp_hls_frag_t *frags; /* circular 2 * winfrags + 1 */
|
ngx_rtmp_hls_frag_t *frags; /* circular 2 * winfrags + 1 */
|
||||||
uint64_t mediaseq;
|
|
||||||
|
|
||||||
ngx_uint_t audio_cc;
|
ngx_uint_t audio_cc;
|
||||||
ngx_uint_t video_cc;
|
ngx_uint_t video_cc;
|
||||||
|
@ -606,7 +605,7 @@ ngx_rtmp_hls_write_playlist(ngx_rtmp_session_t *s, int final)
|
||||||
"#EXT-X-VERSION:3\n"
|
"#EXT-X-VERSION:3\n"
|
||||||
"#EXT-X-MEDIA-SEQUENCE:%uL\n"
|
"#EXT-X-MEDIA-SEQUENCE:%uL\n"
|
||||||
"#EXT-X-TARGETDURATION:%ui\n",
|
"#EXT-X-TARGETDURATION:%ui\n",
|
||||||
ctx->mediaseq++, max_frag);
|
ctx->frag + start_i, max_frag);
|
||||||
|
|
||||||
if (hacf->type == NGX_RTMP_HLS_TYPE_EVENT) {
|
if (hacf->type == NGX_RTMP_HLS_TYPE_EVENT) {
|
||||||
p = ngx_slprintf(p, end, "#EXT-X-PLAYLIST-TYPE:EVENT\n");
|
p = ngx_slprintf(p, end, "#EXT-X-PLAYLIST-TYPE:EVENT\n");
|
||||||
|
|
Loading…
Reference in a new issue