diff options
author | Pavel Koshevoy <pkoshevoy@gmail.com> | 2025-05-18 08:57:31 -0600 |
---|---|---|
committer | Pavel Koshevoy <pkoshevoy@gmail.com> | 2025-05-18 08:57:31 -0600 |
commit | 0021484d05f9b0f032fa319399de6e24eea0c04f (patch) | |
tree | dc22ca10cd9580b2ee41d9950e9e8f7a230fd8f4 /libavformat/mpegts.c | |
parent | 20502ba92a5936bc6a6e006d05828b750f4290ed (diff) | |
download | ffmpeg-0021484d05f9b0f032fa319399de6e24eea0c04f.tar.gz |
avformat/mpegts: update stream info when PMT ES stream_type changes
I have several .ts captures where video and audio codec changes even
though the PMT version does not change and the PIDs stay the same.
This happens during transition to/from slate (mpeg2 video and audio)
to network broadcast (hevc video and eac3 audio in private PES).
I've updated fate ts-demux expected results.
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r-- | libavformat/mpegts.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 54594b3a11..deb69a0548 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -940,6 +940,8 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes, mpegts_find_stream_type(st, pes->stream_type, ISO_types); if (pes->stream_type == STREAM_TYPE_AUDIO_MPEG2 || pes->stream_type == STREAM_TYPE_AUDIO_AAC) sti->request_probe = 50; + if (pes->stream_type == STREAM_TYPE_PRIVATE_DATA) + sti->request_probe = AVPROBE_SCORE_STREAM_RETRY; if ((prog_reg_desc == AV_RL32("HDMV") || prog_reg_desc == AV_RL32("HDPR")) && st->codecpar->codec_id == AV_CODEC_ID_NONE) { @@ -2508,7 +2510,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len if (!st) goto out; - if (pes && !pes->stream_type) + if (pes && pes->stream_type != stream_type) mpegts_set_stream_info(st, pes, stream_type, prog_reg_desc); add_pid_to_program(prg, pid); |