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

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun May 8 07:12:36 CEST 2011

On 8 May 2011, at 00:27, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sat, May 07, 2011 at 09:27:00PM +0200, Reimar Döffinger wrote:
>> Oh, of course, didn't realize I never explained that properly.
>> See the mail I just sent: "[PATCH] Add generic index support to ea demuxer."
> 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);
>                     }

What about make fate for this? Doesn't this for MPEG-ES result in placing the index entries at the wrong place?
Or did you mean to select between these two at run-time?
What condition would you use? Checking for COMPLETE_FRAME will break things for parsers which do not support it correctly, which I think is most.
That is why this approach, please don't take it as offence, feels like hacking around to try to avoid fixing parser output to have some sensible values.

More information about the ffmpeg-devel mailing list