[FFmpeg-cvslog] avformat/mpegts: make sure mpegts_read_header always stops at the first pmt

Marton Balint git at videolan.org
Thu Nov 19 22:48:35 EET 2020


ffmpeg | branch: release/4.3 | Marton Balint <cus at passwd.hu> | Sun Nov 15 00:31:11 2020 +0100| [ca55240b8c1fd4cfdb61f88fd2cb378d475d910a] | committer: Marton Balint

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 at passwd.hu>
(cherry picked from commit bf19833ae26b054a111de79b5ab1681c00cd8d0a)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ca55240b8c1fd4cfdb61f88fd2cb378d475d910a
---

 libavformat/mpegts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);



More information about the ffmpeg-cvslog mailing list