[FFmpeg-cvslog] mpegts: on seek, reset the cc for all PIDs

Aviad Rozenhek git at videolan.org
Mon Sep 12 00:38:56 CEST 2011


ffmpeg | branch: master | Aviad Rozenhek <aviadr1 at gmail.com> | Thu Sep  8 16:18:48 2011 +0300| [162f1fbc147bbff6e23b4df1e587cec5d5111052] | committer: Luca Barbato

mpegts: on seek, reset the cc for all PIDs

Prevent false positive continuity counter error logs.

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

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

 libavformat/mpegts.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index a723418..41a685c 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1410,12 +1410,14 @@ static int handle_packets(MpegTSContext *ts, int nb_packets)
         av_dlog("Skipping after seek\n");
         /* seek detected, flush pes buffer */
         for (i = 0; i < NB_PID_MAX; i++) {
-            if (ts->pids[i] && ts->pids[i]->type == MPEGTS_PES) {
-                PESContext *pes = ts->pids[i]->u.pes_filter.opaque;
-                av_freep(&pes->buffer);
+            if (ts->pids[i]) {
+                if (ts->pids[i]->type == MPEGTS_PES) {
+                   PESContext *pes = ts->pids[i]->u.pes_filter.opaque;
+                   av_freep(&pes->buffer);
+                   pes->data_index = 0;
+                   pes->state = MPEGTS_SKIP; /* skip until pes header */
+                }
                 ts->pids[i]->last_cc = -1;
-                pes->data_index = 0;
-                pes->state = MPEGTS_SKIP; /* skip until pes header */
             }
         }
     }



More information about the ffmpeg-cvslog mailing list