summaryrefslogtreecommitdiffstats
path: root/libavformat/mpegts.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-08 21:25:52 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-11-08 21:35:20 +0100
commit41ad87ad8efe53af1422a0b3abde3d01e470447c (patch)
treee2738efa455119111c61966237ed68253ab7dc18 /libavformat/mpegts.c
parent29b1af40f3a09fafd36bcefb4483353e1b5d82bd (diff)
downloadffmpeg-streaming-41ad87ad8efe53af1422a0b3abde3d01e470447c.zip
ffmpeg-streaming-41ad87ad8efe53af1422a0b3abde3d01e470447c.tar.gz
avformat/mpegts: improve first valid PMT heuristic
This checks for audio+video instead of streams > 2 Fixes Ticket4090 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r--libavformat/mpegts.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index d8e75d9..97da0a3 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2207,7 +2207,12 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
break;
}
if (i == ts->nb_prg && ts->nb_prg > 0) {
- if (ts->stream->nb_streams > 1 || pos > 100000) {
+ int types = 0;
+ for (i = 0; i < ts->stream->nb_streams; i++) {
+ AVStream *st = ts->stream->streams[i];
+ types |= 1<<st->codec->codec_type;
+ }
+ if ((types & (1<<AVMEDIA_TYPE_AUDIO) && types & (1<<AVMEDIA_TYPE_VIDEO)) || pos > 100000) {
av_log(ts->stream, AV_LOG_DEBUG, "All programs have pmt, headers found\n");
ts->stream->ctx_flags &= ~AVFMTCTX_NOHEADER;
}
OpenPOWER on IntegriCloud