Index: /branches/avi_play/src/lib/graphics/importer/media_container.cc
===================================================================
--- /branches/avi_play/src/lib/graphics/importer/media_container.cc	(revision 6126)
+++ /branches/avi_play/src/lib/graphics/importer/media_container.cc	(revision 6127)
@@ -40,5 +40,5 @@
   av_register_all();
 
-  current_frame = 0;
+  fps = 0;
 
   if (filename != NULL)
@@ -89,8 +89,7 @@
       if(frame_finished)
       {
-        current_frame++;
-        PRINTF(1)("current_frame: %i\n", current_frame);
-
-                    // Convert the image from its native format to RGB
+        PRINTF(1)("frame_number: %i\n", codec_context->frame_number);
+
+        // Convert the image from its native format to RGB
         img_convert((AVPicture*)RGB_frame, PIX_FMT_RGB24, (AVPicture*)frame, codec_context->pix_fmt,
                                         codec_context->width, codec_context->height);
@@ -145,5 +144,5 @@
 
   // Open file
-  sprintf(filename, "frame%i.ppm", current_frame);
+  sprintf(filename, "frame%i.ppm", codec_context->frame_number);
   file = fopen(filename, "wb");
   if(file == NULL)
@@ -215,4 +214,6 @@
   avpicture_fill((AVPicture *)RGB_frame, buffer, PIX_FMT_RGB24, codec_context->width, codec_context->height);
 
+  // Calculate fps
+  fps = av_q2d(format_context->streams[video_stream]->r_frame_rate);
 }
 
@@ -227,17 +228,12 @@
 }
 
-int MediaContainer::getCurrentFrame()
-{
-  return this->current_frame;
-}
-
-int MediaContainer::getFrameRate()
-{
-
-}
-
-void MediaContainer::getStream(/* stream */)
-{
-
+int MediaContainer::getFrameNumber()
+{
+  return codec_context->frame_number;
+}
+
+double MediaContainer::getFPS()
+{
+  return this->fps;
 }
 
@@ -258,4 +254,5 @@
   PRINTF(1)("nb_frames: %i\n", format_context->streams[video_stream]->nb_frames);
   PRINTF(1)("r_frame_rate: %i\n", format_context->streams[video_stream]->r_frame_rate.num);
+  PRINTF(1)("FPS: %f\n", av_q2d(format_context->streams[video_stream]->r_frame_rate));
   PRINTF(1)("========================\n");
   PRINTF(1)("=    AVCodecContext    =\n");
@@ -263,4 +260,6 @@
   PRINTF(1)("width: %i\n", codec_context->width);
   PRINTF(1)("height: %i\n", codec_context->height);
+  PRINTF(1)("time_base.den: %i\n", codec_context->time_base.den);
+  PRINTF(1)("time_base.num: %i\n", codec_context->time_base.num);
   PRINTF(1)("========================\n");
   PRINTF(1)("=       AVCodec        =\n");
@@ -286,2 +285,8 @@
   PRINTF(1)("========================\n");
 }
+
+
+//pts = av_q2d(is->video_st->time_base)*pkt->dts;
+//pkt = packet
+//avstrream = viedo_st
+//pts = double
Index: /branches/avi_play/src/lib/graphics/importer/media_container.h
===================================================================
--- /branches/avi_play/src/lib/graphics/importer/media_container.h	(revision 6126)
+++ /branches/avi_play/src/lib/graphics/importer/media_container.h	(revision 6127)
@@ -29,6 +29,5 @@
 private:
 
-  int current_frame;
-  int num_frames;
+  double fps;
   GLuint texture;
   uint8_t* data;
@@ -57,7 +56,6 @@
   int getHeight();
   int getWidth();
-  int getCurrentFrame();
-  int getFrameRate();
-  void getStream(/* stream */);
+  int getFrameNumber();
+  double getFPS();
 
   /* prints some information about the
Index: /branches/avi_play/src/subprojects/importer/importer.cc
===================================================================
--- /branches/avi_play/src/subprojects/importer/importer.cc	(revision 6126)
+++ /branches/avi_play/src/subprojects/importer/importer.cc	(revision 6127)
@@ -60,6 +60,6 @@
 void Framework::moduleTick(float dt)
 {
-  while(movie->getNextFrame() != NULL)
-    movie->saveCurrentFrame();	
+  //while(movie->getNextFrame() != NULL);
+  //  movie->saveCurrentFrame();	
 }
 
Index: /branches/avi_play/src/subprojects/importer/multitex.cc
===================================================================
--- /branches/avi_play/src/subprojects/importer/multitex.cc	(revision 6126)
+++ /branches/avi_play/src/subprojects/importer/multitex.cc	(revision 6127)
@@ -37,10 +37,10 @@
 MediaContainer* movie;
 
-int counter = 0;
+float counter = 0;
 
 
 void Framework::moduleInit(int argc, char** argv)
 {
-  movie = new MediaContainer("/home/lieni/Desktop/Face2.avi");
+  movie = new MediaContainer("/home/david/Desktop/Face2.avi");
 
   // print information about the media file
@@ -52,15 +52,15 @@
 
   seq = new TextureSequence();
-  //for (int i = 1; i < argc; i++)
-  //{
-  //  seq->addFrame(argv[i]);
-  //  printf("%s\n", argv[i]);
-  //}
+  for (int i = 1; i < argc; i++)
+  {
+    seq->addFrame(argv[i]);
+    printf("%s\n", argv[i]);
+  }
 
   // add one frame from the movie
-  //seq->addFrame(movie->getNextFrame());
+  seq->addFrame(movie->getNextFrame());
   GLuint tex;
-  while((tex = movie->getNextFrame()) != NULL)
-    seq->addFrame(tex);
+  //while((tex = movie->getNextFrame()) != NULL)
+  //  seq->addFrame(tex);
 
   test = new Texture(argv[1]);
@@ -102,9 +102,9 @@
 void Framework::moduleTick(float dt)
 {
-  counter++;
+  counter += dt;
 
-  seq->gotoFrame(counter);
+  seq->gotoFrame((unsigned int)counter);
 
-  if (counter > seq->getFrameCount())
+  if ((unsigned int)counter > seq->getFrameCount())
     counter = 0;
 
