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

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon May 9 08:42:22 CEST 2011

On Sun, May 08, 2011 at 12:27:39AM +0200, Michael Niedermayer wrote:
> the ea case is fixed by my suggestion of
> index 4a4141e..c60d27f 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -1103,7 +1103,7 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt)
>                      if((s->iformat->flags & AVFMT_GENERIC_INDEX) && pkt->flags & AV_PKT_FLAG_KEY){
>                          ff_reduce_index(s, st->index);
> -                        av_add_index_entry(st, st->parser->frame_offset, pkt->dts,
> +                        av_add_index_entry(st, pkt->pos, pkt->dts,
>                                             0, 0, AVINDEX_KEYFRAME);
>                      }

Sorry, I was being stupid. I think this actually does what I attempted
to do in my previous patch without fiddling with internals.
For some reason I was convinced that parser->pos had the same fiddling
applied as st->parser->frame_offset.
Could you push this (or to avoid changes to existing behaviour, this with
an additional condition so st->parser->frame_offset is still used if
e.g. COMPLETE_FRAMES is not set or a similar condition)?

More information about the ffmpeg-devel mailing list