Modified:
trunk/src/avbin.c
Log:
Fix seek to 0 in OGG files.
Modified: trunk/src/avbin.c
==============================================================================
--- trunk/src/avbin.c (original)
+++ trunk/src/avbin.c Thu May 15 06:06:06 2008
@@ -145,7 +145,21 @@
AVbinResult avbin_seek_file(AVbinFile *file, AVbinTimestamp timestamp)
{
- av_seek_frame(file->context, -1, timestamp, 0);
+ int i;
+ AVCodecContext *codec_context;
+
+ if (!timestamp)
+ av_seek_frame(file->context, -1, 0,
+ AVSEEK_FLAG_ANY | AVSEEK_FLAG_BYTE);
+ else
+ av_seek_frame(file->context, -1, timestamp, 0);
+
+ for (i = 0; i < file->context->nb_streams; i++)
+ {
+ codec_context = file->context->streams[i]->codec;
+ if (codec_context)
+ avcodec_flush_buffers(codec_context);
+ }
return AVBIN_RESULT_OK;
}