diff --git a/hls/ngx_rtmp_mpegts.c b/hls/ngx_rtmp_mpegts.c index 9660807..0de52ec 100644 --- a/hls/ngx_rtmp_mpegts.c +++ b/hls/ngx_rtmp_mpegts.c @@ -17,9 +17,9 @@ static u_char ngx_rtmp_mpegts_header[] = { /* PSI */ 0x00, 0xb0, 0x0d, 0x00, 0x01, 0xc1, 0x00, 0x00, /* PAT */ - 0x00, 0x01, 0xf0, 0x01, + 0x00, 0x01, 0xef, 0xff, /* CRC */ - 0x2e, 0x70, 0x19, 0x05, + 0x36, 0x90, 0xe2, 0x3d, /* stuffing 167 bytes */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -40,7 +40,7 @@ static u_char ngx_rtmp_mpegts_header[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* TS */ - 0x47, 0x50, 0x01, 0x10, 0x00, + 0x47, 0x4f, 0xff, 0x10, 0x00, /* PSI */ 0x02, 0xb0, 0x17, 0x00, 0x01, 0xc1, 0x00, 0x00, /* PMT */ @@ -250,14 +250,12 @@ ngx_rtmp_mpegts_write_frame(ngx_rtmp_mpegts_file_t *file, if (first) { - if (f->key) { - packet[3] |= 0x20; /* adaptation */ + packet[3] |= 0x20; /* adaptation */ - *p++ = 7; /* size */ - *p++ = 0x50; /* random access + PCR */ + *p++ = 7; /* size */ + *p++ = 0x50; /* random access + PCR */ - p = ngx_rtmp_mpegts_write_pcr(p, f->dts - NGX_RTMP_HLS_DELAY); - } + p = ngx_rtmp_mpegts_write_pcr(p, f->dts - NGX_RTMP_HLS_DELAY); /* PES header */