[Ffmpeg-devel] [RFC] av_seek_frame behaviour
Michael Niedermayer
michaelni
Mon Apr 23 13:39:06 CEST 2007
Hi
On Mon, Apr 23, 2007 at 01:28:45PM +0200, Baptiste Coudurier wrote:
[...]
> > also av_seek_frame_generic() just
> > reads the file linearly from the last position to the point to which the
> > user wants to seek so even with huge files a little forward/backward
> > seeking should be ok
>
> Humm:
>
> if(index < 0 || index==st->nb_index_entries-1){
> int i;
> AVPacket pkt;
>
> if(st->index_entries && st->nb_index_entries){
> ie= &st->index_entries[st->nb_index_entries-1];
> url_fseek(&s->pb, ie->pos, SEEK_SET);
> av_update_cur_dts(s, st, ie->timestamp);
> }else
> url_fseek(&s->pb, 0, SEEK_SET);
>
> In fact av_seek_frame_generic seek back to the beginning of file if no
> index is there, maybe it is not wanted ? Or see below.
>
> > that is unless the demuxer doesnt use av_add_index_entry() properly
>
> Ok, so demuxer should use av_add_index_entry ?
if it wants to use the avindex to seek either directly or through a function
like av_seek_frame_generic() ...
> Im not against that, it
> just needs to check all demuxers.
>
> > also iam not opposed to add some flags so that the user can indicate
> > the amount of accuracy/speed she wants but first we actually need
> > to have multiple working seek variants before a API to access them
> > makes sense ...
>
> Agree. I began to check some seek functions:
>
> TS seems to use av_seek_frame_binary internally and returning -1 which
> will make av_seek_frame to call av_seek_frame_binary again. Twice try in
> case of failure.
:(
[...]
> FLV seems to work removing seek function and letting av_seek_frame
> calling av_seek_frame_generic.
ok, feel free to remove it (if the seek regression tests related to
flv dont change)
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I count him braver who overcomes his desires than him who conquers his
enemies for the hardest victory is over self. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070423/cf123789/attachment.pgp>
More information about the ffmpeg-devel
mailing list