Index: /branches/avi_play/src/lib/graphics/importer/media_container.cc
===================================================================
--- /branches/avi_play/src/lib/graphics/importer/media_container.cc	(revision 6381)
+++ /branches/avi_play/src/lib/graphics/importer/media_container.cc	(revision 6382)
@@ -88,16 +88,6 @@
 
   // Find the first video stream and take it
-  video_stream = -1;
-  for(int i = 0; i < format_context->nb_streams; i++)
-  {
-    // NOTE: different code for the 0.4.9-pre1 release of ffmpeg (tardis)
-    // if(format_context->streams[i]->codec.codec_type == CODEC_TYPE_VIDEO)
-    if(format_context->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO)
-    {
-      video_stream = i;
-      break;
-    }
-  }
-
+  video_stream = av_find_default_stream_index(format_context);
+  
   if(video_stream == -1)
     PRINTF(1)("Could not find a video stream in %s\n", filename);
@@ -124,4 +114,7 @@
   num_bytes = avpicture_get_size(PIX_FMT_RGB24, codec_context->width, codec_context->height);
   buffer=new uint8_t[num_bytes];
+
+  // data buffer for the texture
+  data = new uint8_t[codec_context->width*codec_context->height*3*sizeof(uint8_t)];
 
   // Assign appropriate parts of buffer to image planes in RGB_frame
@@ -180,6 +173,4 @@
                     codec_context->pix_fmt, codec_context->width, codec_context->height);
 
-        data = 0;
-        data = new uint8_t[codec_context->width*codec_context->height*3*sizeof(uint8_t)];
         for(int i = 0; i < codec_context->height; i++)
           memcpy(&data[i*codec_context->width*3],
@@ -187,6 +178,6 @@
                  ((AVPicture*)RGB_frame)->linesize[0], 
                   codec_context->width*sizeof(uint8_t)*3); 
-/*
-        surface = SDL_CreateRGBSurfaceFrom(data, codec_context->width,
+
+        /*surface = SDL_CreateRGBSurfaceFrom(data, codec_context->width,
                                            codec_context->height,24,
                                            codec_context->width*sizeof(uint8_t)*3,
@@ -226,5 +217,5 @@
                         GL_UNSIGNED_BYTE,
                         surface->pixels);
-        glBindTexture(GL_TEXTURE_2D, 0);  */   
+        glBindTexture(GL_TEXTURE_2D, 0); */
 
         // Create an OpenGL texture
Index: /branches/avi_play/src/lib/graphics/importer/movie_player.cc
===================================================================
--- /branches/avi_play/src/lib/graphics/importer/movie_player.cc	(revision 6381)
+++ /branches/avi_play/src/lib/graphics/importer/movie_player.cc	(revision 6382)
@@ -102,15 +102,5 @@
 
   // Find the first video stream and take it
-  video_stream = -1;
-  for(int i = 0; i < format_context->nb_streams; i++)
-  {
-    // NOTE: different code for the 0.4.9-pre1 release of ffmpeg (tardis)
-    // if(format_context->streams[i]->codec.codec_type == CODEC_TYPE_VIDEO)
-    if(format_context->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO)
-    {
-      video_stream = i;
-      break;
-    }
-  }
+  video_stream = av_find_default_stream_index(format_context);
 
   if(video_stream == -1)
@@ -141,4 +131,7 @@
   // Assign appropriate parts of buffer to image planes in RGB_frame
   avpicture_fill((AVPicture *)RGB_frame, buffer, PIX_FMT_RGB24, codec_context->width, codec_context->height);
+
+  // data buffer for the texture
+  data = new uint8_t[codec_context->width*codec_context->height*3*sizeof(uint8_t)];
 
   // Calculate fps
@@ -192,6 +185,4 @@
                     codec_context->pix_fmt, codec_context->width, codec_context->height);
 
-        data = 0;
-        data = new uint8_t[codec_context->width*codec_context->height*3*sizeof(uint8_t)];
         for(int i = 0; i < codec_context->height; i++)
           memcpy(&data[i*codec_context->width*3], ((AVPicture*)RGB_frame)->data[0]+i *
@@ -247,6 +238,4 @@
                         data);
         glBindTexture(GL_TEXTURE_2D, 0);
-
-        //avcodec_flush_buffers(codec_context);
 
       }
@@ -327,5 +316,5 @@
 }
 
-void MoviePlayer::start(unsigned int start_time)
+void MoviePlayer::start(float start_time)
 {
   status = PLAY;
@@ -339,18 +328,18 @@
 void MoviePlayer::resume()
 {
-  if(status == STOP)
-    this->start(0);
-  else
+  if(status == PAUSE)
+  {
     status = PLAY;
-
-   PRINTF(0)("resume\n");
+    PRINTF(0)("resume\n");
+  }
 }
 
 void MoviePlayer::pause()
 {
-  if(status != STOP)
+  if(status == PLAY)
+  {
     status = PAUSE;
-
-  PRINTF(0)("pause\n");
+    PRINTF(0)("pause\n");
+  }
 }
 
Index: /branches/avi_play/src/lib/graphics/importer/movie_player.h
===================================================================
--- /branches/avi_play/src/lib/graphics/importer/movie_player.h	(revision 6381)
+++ /branches/avi_play/src/lib/graphics/importer/movie_player.h	(revision 6382)
@@ -71,5 +71,5 @@
   void loadMovie(const char* filename);
 
-	void start(unsigned int start_time);
+	void start(float start_time);
 	void resume();
 	void pause();
Index: /branches/avi_play/src/subprojects/importer/movie_player_test.cc
===================================================================
--- /branches/avi_play/src/subprojects/importer/movie_player_test.cc	(revision 6381)
+++ /branches/avi_play/src/subprojects/importer/movie_player_test.cc	(revision 6382)
@@ -22,10 +22,20 @@
 
 MoviePlayer* movie_player;
+float start_time;
 
 void Framework::moduleInit(int argc, char** argv)
 {
+  if( argc <= 1)
+  {
+    printf("Wrong arguments try following notations:\n");
+    printf("./movie_player_test [media_file]\n");
+    exit(0);
+  }
+
   movie_player = new MoviePlayer(argv[1]);
-
   movie_player->printInformation();
+  
+  //start_time = atoi(argv[2]);
+  start_time = 0;
 }
 
@@ -38,5 +48,5 @@
       {
         case SDLK_1:
-          movie_player->start(0);
+          movie_player->start(start_time);
           break;
         case SDLK_2:
Index: /branches/avi_play/src/subprojects/importer/multitex.cc
===================================================================
--- /branches/avi_play/src/subprojects/importer/multitex.cc	(revision 6381)
+++ /branches/avi_play/src/subprojects/importer/multitex.cc	(revision 6382)
@@ -74,10 +74,4 @@
           obj = new PrimitiveModel(PRIM_PLANE, 10.0);
           break;
-        case SDLK_5:
-          media_container->loadFrames();
-          counter = 0;
-          timer = 0;
-          SDL_Delay(1000);
-          break;
         // increase fps
         case SDLK_9:
@@ -107,6 +101,4 @@
       timer = 0;
       counter = 0;
-      PRINTF(0)("BEGIN\n");
-      PRINTF(0)("total_frames: %i\n", media_container->getFrameCount());
     }
   }
