Commit 2c500f50 authored by Aman Gupta's avatar Aman Gupta

avformat/mpegts: skip non-PMT tids earlier

This mimics the logic flow in all the other callbacks
(pat_cb, sdt_cb, m4sl_cb), and avoids calling skip_identical()
for non PMT_TID packets.

Since skip_identical modifies internal state like
MpegTSSectionFilter.last_ver, this change prevents unnecessary
reprocessing on some streams which contain multiple tables in
the PMT pid. This can be observed with streams from certain US
cable providers, which include both tid=0x2 and another unspecified
tid=0xc0.
Signed-off-by: 's avatarAman Gupta <aman@tmm1.net>
parent 12ceaf0f
...@@ -2000,14 +2000,14 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len ...@@ -2000,14 +2000,14 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
p = section; p = section;
if (parse_section_header(h, &p, p_end) < 0) if (parse_section_header(h, &p, p_end) < 0)
return; return;
if (h->tid != PMT_TID)
return;
if (skip_identical(h, tssf)) if (skip_identical(h, tssf))
return; return;
av_log(ts->stream, AV_LOG_TRACE, "sid=0x%x sec_num=%d/%d version=%d tid=%d\n", av_log(ts->stream, AV_LOG_TRACE, "sid=0x%x sec_num=%d/%d version=%d tid=%d\n",
h->id, h->sec_num, h->last_sec_num, h->version, h->tid); h->id, h->sec_num, h->last_sec_num, h->version, h->tid);
if (h->tid != PMT_TID)
return;
if (!ts->scan_all_pmts && ts->skip_changes) if (!ts->scan_all_pmts && ts->skip_changes)
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment