[FFmpeg-devel] [PATCH] oggdec: add missing ogg_reset on seek.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Feb 4 21:05:33 CET 2012


It would never be called when the searched-for position
was already in the index.
In the other cases, the ogg_reset at the end of the
read_timestamp function handled it.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
---
 libavformat/oggdec.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 9e6832b..ab71b39 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -671,6 +671,10 @@ static int ogg_read_seek(AVFormatContext *s, int stream_index,
     struct ogg_stream *os = ogg->streams + stream_index;
     int ret;
 
+    // Ensure everything is reset even when seeking via
+    // the generated index.
+    ogg_reset(ogg);
+
     // Try seeking to a keyframe first. If this fails (very possible),
     // av_seek_frame will fall back to ignoring keyframes
     if (s->streams[stream_index]->codec->codec_type == AVMEDIA_TYPE_VIDEO
-- 
1.7.9



More information about the ffmpeg-devel mailing list