[FFmpeg-devel] update data_offset field in format context

Reimar Döffinger Reimar.Doeffinger
Thu Nov 6 19:17:37 CET 2008


On Thu, Nov 06, 2008 at 06:42:33PM +0100, Michael Niedermayer wrote:
> On Thu, Nov 06, 2008 at 05:50:46PM +0200, Yoav Steinberg wrote:
> > Currently the:
> >          if (pb && !ic->data_offset)
> >              ic->data_offset = url_ftell(ic->pb);
> > 
> > in the core attempts to use the current position if it wasn't set by the 
> > demuxer, indicating a "best guess" policy. I was attempting in the patch 
> > to improve the guessing by employing the index entries table when available.
> 
> well i didnt write these 2 lines IIRC so i can nt say for sure but not every
> piece of common code is a "best guess code"
> one very well could see it the other way around, that its factorized code
> from demuxers and only executed when its exactly correct.

To my knowledge the way it is used currently it definitely is not a best
guess, but actually it is a location in the file that the demuxer will
be able to demux from if you just seek at the stream layer.
It may be ugly, but I think some demuxers (mtv.c) rely on this and changing it
is likely to break seeking.
Though on looking at it again it seems a bit wrong, going by the
description it should be set to pkt->pos of the first demuxed packet...

Greetings,
Reimar D?ffinger




More information about the ffmpeg-devel mailing list