[avbin commit] r31 - trunk/src

0 views
Skip to first unread message

codesite...@google.com

unread,
May 15, 2008, 9:06:50 AM5/15/08
to avbin-...@googlegroups.com
Author: Alex.Holkner
Date: Thu May 15 06:06:06 2008
New Revision: 31

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;
}

Reply all
Reply to author
Forward
0 new messages