Index: branches/avi_play/src/lib/graphics/importer/media_container.cc
===================================================================
--- branches/avi_play/src/lib/graphics/importer/media_container.cc	(revision 6323)
+++ branches/avi_play/src/lib/graphics/importer/media_container.cc	(revision 6324)
@@ -87,5 +87,5 @@
 }
 
-GLuint MediaContainer::getFrame(int frame_number)
+void MediaContainer::gotoFrame(int frame_number)
 {
   // seek doesnt work for the first two frames
@@ -96,5 +96,4 @@
     av_seek_frame(format_context, video_stream, 0, AVSEEK_FLAG_BACKWARD);
     frame_num = 0;
-    return this->getNextFrame();
   }
   else
@@ -117,6 +116,4 @@
   
     frame_num = frame_number;
-
-    return this->getNextFrame();
   }
 }
@@ -215,7 +212,27 @@
 }
 
-void MediaContainer::skipFrame(int num_frames)
-{
-
+GLuint MediaContainer::skipFrame(int num_frames)
+{
+  frame_num += num_frames;
+  
+  while(num_frames != 0)
+  {
+    if(av_read_frame(format_context, &packet) < 0)
+      break;
+    if(packet.stream_index == video_stream)
+    {
+      int frame_finished;
+      // We have to decode the frame to not get ugly fragments
+      avcodec_decode_video(codec_context, frame, &frame_finished,
+                            packet.data, packet.size);
+        
+      // Did we get a video frame?
+      if(frame_finished)
+        num_frames--;
+    }
+    av_free_packet(&packet);
+  }
+  
+  return this->getNextFrame();
 }
 
Index: branches/avi_play/src/lib/graphics/importer/media_container.h
===================================================================
--- branches/avi_play/src/lib/graphics/importer/media_container.h	(revision 6323)
+++ branches/avi_play/src/lib/graphics/importer/media_container.h	(revision 6324)
@@ -58,7 +58,7 @@
 
   void init();
-  GLuint getFrame(int frame_number);
+  void gotoFrame(int frame_number);
   GLuint getNextFrame();
-  void skipFrame(int num_frames);
+  GLuint skipFrame(int num_frames);
   vector<GLuint> getFrameList();
   void loadMedia(const char* filename);
Index: branches/avi_play/src/lib/graphics/importer/movie_player.cc
===================================================================
--- branches/avi_play/src/lib/graphics/importer/movie_player.cc	(revision 6323)
+++ branches/avi_play/src/lib/graphics/importer/movie_player.cc	(revision 6324)
@@ -57,4 +57,5 @@
 {
   status = STOP;
+  timer = 0;
 
   material = new Material;
@@ -82,7 +83,11 @@
 void MoviePlayer::start(unsigned int start_frame)
 {
-  texture = media_container->getFrame(start_frame);
+  status = PLAY;
+  timer = 0;
+  fps = media_container->getFPS();
 
-  status = PLAY;
+  media_container->gotoFrame(start_frame);
+
+   PRINTF(0)("start\n");
 }
 
@@ -90,6 +95,9 @@
 {
   if(status == STOP)
-    texture = media_container->getFrame(0);
-  status = PLAY;
+    this->start(0);
+  else
+    status = PLAY;
+
+   PRINTF(0)("resume\n");
 }
 
@@ -98,4 +106,6 @@
   if(status != STOP)
     status = PAUSE;
+
+  PRINTF(0)("pause\n");
 }
 
@@ -104,14 +114,27 @@
   status = STOP;
   texture = NULL;
+
+  PRINTF(0)("stop\n");
 }
 
-void MoviePlayer::tick(float time)
+void MoviePlayer::tick(float dt)
 {
   if(status == PLAY)
   {
-    texture = media_container->getNextFrame();
+    current_frame = media_container->getFrameNumber();
+    timer += dt;
+    actuel_frame = timer * fps;
+
+    if(actuel_frame != current_frame)
+    {
+      if(actuel_frame - current_frame == 1)
+        texture = media_container->getNextFrame();
+      else
+        texture = media_container->skipFrame(actuel_frame - current_frame - 1);
+    }   
     //PRINTF(0)("frame_number: %i\n", media_container->getFrameNumber());
-    if(texture == NULL)
-      status = STOP;
+
+    if(texture == NULL && current_frame != 0)
+      this->stop();
   }
 }
Index: branches/avi_play/src/lib/graphics/importer/movie_player.h
===================================================================
--- branches/avi_play/src/lib/graphics/importer/movie_player.h	(revision 6323)
+++ branches/avi_play/src/lib/graphics/importer/movie_player.h	(revision 6324)
@@ -39,5 +39,9 @@
 
   MP_STATUS status;	
-  float speed;  
+  float speed;
+  float timer;
+  int actuel_frame;
+  int current_frame;
+  float fps;  
 
 public:
@@ -55,5 +59,5 @@
 	void stop();
 
-	void tick(float time);
+	void tick(float dt);
 	const void draw();
 
