summaryrefslogtreecommitdiff
path: root/libavformat/mpegts.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r--libavformat/mpegts.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index b8c7f5f921..49dd1b1e20 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1321,7 +1321,9 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
tss->last_cc = cc;
if (!cc_ok) {
- av_log(ts->stream, AV_LOG_WARNING, "Continuity Check Failed\n");
+ av_log(ts->stream, AV_LOG_WARNING,
+ "Continuity check failed for pid %d expected %d got %d\n",
+ pid, expected_cc, cc);
if(tss->type == MPEGTS_PES) {
PESContext *pc = tss->u.pes_filter.opaque;
pc->flags |= AV_PKT_FLAG_CORRUPT;
@@ -1439,12 +1441,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 */
}
}
}