aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mpegts.c
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2018-05-08 15:07:35 -0700
committerAman Gupta <aman@tmm1.net>2018-05-09 12:39:55 -0700
commit2c500f50972c19f25ebca783ba9374d6a0c23efb (patch)
treeab0d94334043907fea57bbb7cfff728e10b66045 /libavformat/mpegts.c
parent12ceaf0fbacb20b86bdc343ba2bbc71d2fff72e0 (diff)
downloadffmpeg-2c500f50972c19f25ebca783ba9374d6a0c23efb.tar.gz
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: Aman Gupta <aman@tmm1.net>
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r--libavformat/mpegts.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 629631f60a..5c9ff73133 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2000,14 +2000,14 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
p = section;
if (parse_section_header(h, &p, p_end) < 0)
return;
+ if (h->tid != PMT_TID)
+ return;
if (skip_identical(h, tssf))
return;
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);
- if (h->tid != PMT_TID)
- return;
if (!ts->scan_all_pmts && ts->skip_changes)
return;