[FFmpeg-devel] [PATCH] seeking in asf files where audio stream is found before video

elupus elupus
Sun Jul 8 00:00:10 CEST 2007


Currently asf demuxer reads the index provided in the file on first seek and 
adds it to the stream that the seek occured in. Any seeks on other streams 
in the file will then not use the provided index.

This turns out to be an issue since av_find_stream_info will seek to pts 0 
for all available streams, if audio is found first, then index get's loaded 
on the audio stream. When a seek is tried later, the default stream seeked 
is the video stream wich doesn't have an index loaded.

If an asf stream doesn't have a index, it defaults to binary seek, wich will 
then add some index points to the stream, on the next seek those will be 
used without interpolation.

This patch changes the demuxer to only load index for the video stream, and 
fall back to the general seeks in utils.c if its internal seek doesn't work.

Sadly seem to be a bug in av_gen_search, wich happens to search the whole 
damn file when av_find_stream_info tries to seeks to pts 0, so there is also 
a hack in this patch to handle seeks to time 0.

On another note, shouldn't the demuxer set AVFormatContext->data_offset 
instead of just setting data_offset in ASFContext? If so i can provide a 
patch for that.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: asf.patch
Type: application/octet-stream
Size: 1110 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070708/a39dc8b0/attachment.obj>

More information about the ffmpeg-devel mailing list