aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mpegts.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2020-11-15 00:31:11 +0100
committerMarton Balint <cus@passwd.hu>2020-11-19 21:42:39 +0100
commitca55240b8c1fd4cfdb61f88fd2cb378d475d910a (patch)
treef65f632e9ab46fbe52369813c923f5e2f047be13 /libavformat/mpegts.c
parent1936413edaf6bb9596cb534d47c2b8d48135d132 (diff)
downloadffmpeg-ca55240b8c1fd4cfdb61f88fd2cb378d475d910a.tar.gz
avformat/mpegts: make sure mpegts_read_header always stops at the first pmt
mpegts_read_header stops parsing the file at the first PMT. However the check that ensured this was wrong because streams can also be added before the first PMT is received (e.g. EIT). So let's make sure we are in the header reading phase by checking if ts->pkt is unset instead of checking if the number of streams found so far is 0. Signed-off-by: Marton Balint <cus@passwd.hu> (cherry picked from commit bf19833ae26b054a111de79b5ab1681c00cd8d0a)
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r--libavformat/mpegts.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index c6fd3e1cef..1da81a0fe6 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2352,7 +2352,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
goto out;
// stop parsing after pmt, we found header
- if (!ts->stream->nb_streams)
+ if (!ts->pkt)
ts->stop_parse = 2;
set_pmt_found(ts, h->id);