Skip to content
This repository has been archived by the owner on Jun 4, 2023. It is now read-only.

Commit

Permalink
avformat/mpegts: make sure mpegts_read_header always stops at the fir…
Browse files Browse the repository at this point in the history
…st 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 <[email protected]>
  • Loading branch information
cus authored and phunkyfish committed Nov 15, 2020
1 parent 5a1e9dc commit 3136f41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavformat/mpegts.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3136f41

Please sign in to comment.