[FFmpeg-devel] [PATCH 16/16] mpegts: do not return from ff_mpegts_parse_packet() after having seen the first PMT

fenrir at elivagar.org fenrir at elivagar.org
Sat Oct 8 23:40:41 CEST 2011


From: Laurent Aimar <fenrir at videolan.org>

It prevents leaving the AVPacket uninitialized.
---
 libavformat/mpegts.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index f3d8b35..1de9060 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1891,10 +1891,8 @@ int ff_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt,
 
     len1 = len;
     ts->pkt = pkt;
-    ts->stop_parse = 0;
     for(;;) {
-        if (ts->stop_parse>0)
-            break;
+        ts->stop_parse = 0;
         if (len < TS_PACKET_SIZE)
             return -1;
         if (buf[0] != 0x47) {
@@ -1904,6 +1902,8 @@ int ff_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt,
             handle_packet(ts, buf);
             buf += TS_PACKET_SIZE;
             len -= TS_PACKET_SIZE;
+            if (ts->stop_parse == 1)
+                break;
         }
     }
     return len1 - len;
-- 
1.7.2.5



More information about the ffmpeg-devel mailing list