[FFmpeg-devel] [PATCH] Only using st->parser->pos when doing repacking in the parser.

Michael Niedermayer michaelni at gmx.at
Sun Apr 24 23:28:42 CEST 2011


On Sun, Apr 24, 2011 at 06:17:14PM +0200, Reimar Döffinger wrote:
> ---
>  libavformat/utils.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index e7ce911..d2b8fc2 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -1069,7 +1069,11 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt)
>                      pkt->stream_index = st->index;
>                      pkt->pts = st->parser->pts;
>                      pkt->dts = st->parser->dts;
> -                    pkt->pos = st->parser->pos;
> +                    // When not repacking, using parser pos can at best break
> +                    // things since parsers are not designed to handle the
> +                    // case where current packet pos + size < next packet pos
> +                    if (st->needs_parsing == AVSTREAM_PARSE_FULL)
> +                        pkt->pos = st->parser->pos;

i think this should also check for AVSTREAM_PARSE_TIMESTAMPS
otherwise LGTM if it fixes something

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110424/25feecc0/attachment.asc>


More information about the ffmpeg-devel mailing list