Index: OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoder.cpp
===================================================================
--- OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoder.cpp (revision 10809)
+++ OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoder.cpp (revision 10851)
@@ -214,13 +214,4 @@
 }
 
-void FFmpegDecoder::resume() 
-{
-    m_pending_packet.clear();
-
-    flushAudioQueue();
-    flushVideoQueue();
-    m_state = NORMAL;
-}
-
 void FFmpegDecoder::findAudioStream()
 {
@@ -295,5 +286,8 @@
             // If we reach the end of the stream, change the decoder state
             if (loop())
+            {
+                m_clocks.reset(m_start);
                 rewindButDontFlushQueues();
+            }
             else
                 m_state = END_OF_STREAM;
@@ -394,4 +388,6 @@
     const int64_t seek_target = av_rescale_q(pos, AvTimeBaseQ, m_video_stream->time_base);
 
+    m_clocks.setSeekTime(time);
+
     if (av_seek_frame(m_format_context.get(), m_video_index, seek_target, 0/*AVSEEK_FLAG_BYTE |*/ /*AVSEEK_FLAG_BACKWARD*/) < 0)
         throw std::runtime_error("av_seek_frame failed()");
