[FFmpeg-cvslog] avformat/mpegts: Continue parsing PMTs until at least 2 streams are found or 100kb are reached

Michael Niedermayer git at videolan.org
Wed Jan 29 06:04:19 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jan 29 05:44:03 2014 +0100| [29986885ef7d87b009ed923fe721fbb6ccb9e398] | committer: Michael Niedermayer

avformat/mpegts: Continue parsing PMTs until at least 2 streams are found or 100kb are reached

This (ugly) hack fixes Ticket3348
If someone has an idea on how to fix this nicer, that would be very welcome
but the stream contains several PMTs with just one of the 2 streams at the start

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/mpegts.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index db697e4..53de4ac 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1988,8 +1988,10 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
                     break;
             }
             if (i == ts->nb_prg && ts->nb_prg > 0) {
-                av_log(ts->stream, AV_LOG_DEBUG, "All programs have pmt, headers found\n");
-                ts->stream->ctx_flags &= ~AVFMTCTX_NOHEADER;
+                if (ts->stream->nb_streams > 1 || pos > 100000) {
+                    av_log(ts->stream, AV_LOG_DEBUG, "All programs have pmt, headers found\n");
+                    ts->stream->ctx_flags &= ~AVFMTCTX_NOHEADER;
+                }
             }
         }
 



More information about the ffmpeg-cvslog mailing list