[FFmpeg-devel] [PATCH] mpegts demuxer gives bogus data after seeking

Baptiste Coudurier baptiste.coudurier
Tue May 5 04:02:07 CEST 2009


On 5/4/2009 2:18 PM, Wolfram Gloger wrote:
> [...]
> 
> --- ffmpeg-test/libavformat/mpegts.c.orig	2009-04-12 11:04:12.000000000 +0200
> +++ ffmpeg-test/libavformat/mpegts.c	2009-05-04 23:10:00.000000000 +0200
> @@ -1437,6 +1437,15 @@
>      MpegTSContext *ts = s->priv_data;
>      uint8_t buf[TS_PACKET_SIZE];
>      int64_t pos;
> +    int i;
> +
> +    // make sure that no old PES data is handed out in any case
> +    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;
> +
> +            pes->state = MPEGTS_SKIP;
> +        }
>  

This patch won't work if user uses AVSEEK_FLAG_BYTE which does not call
read_seek. Seek detection must be added in mpegts_read_frame, and if
seek is detected flush must be done.

[...]

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
checking for life_signs in -lkenny... no
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list