Index: branches/avi_play/src/lib/graphics/importer/media_container.cc
===================================================================
--- branches/avi_play/src/lib/graphics/importer/media_container.cc	(revision 6709)
+++ branches/avi_play/src/lib/graphics/importer/media_container.cc	(revision 6711)
@@ -45,13 +45,4 @@
 }
 
-MediaContainer::MediaContainer()
-{
-  // set the class id for the base object
-  this->setClassID(CL_MEDIA_CONTAINER, "MediaContainer");
-
-  fps = 0;
-  mediaLoaded = false;
-}
-
 /**
  * Default destructor
@@ -105,6 +96,4 @@
     return false;
   }
-
-
 
   // register all formats and codecs
Index: branches/avi_play/src/lib/graphics/importer/media_container.h
===================================================================
--- branches/avi_play/src/lib/graphics/importer/media_container.h	(revision 6709)
+++ branches/avi_play/src/lib/graphics/importer/media_container.h	(revision 6711)
@@ -44,6 +44,5 @@
 public:
 
-  MediaContainer(const char* filename);
-  MediaContainer();
+  MediaContainer(const char* filename = NULL);
   ~MediaContainer();
 
Index: branches/avi_play/src/lib/graphics/importer/movie_player.cc
===================================================================
--- branches/avi_play/src/lib/graphics/importer/movie_player.cc	(revision 6709)
+++ branches/avi_play/src/lib/graphics/importer/movie_player.cc	(revision 6711)
@@ -33,22 +33,28 @@
 MoviePlayer::MoviePlayer(const char* filename)
 {
-  this->init();
-
-  if (filename != NULL)
-  {
-    if(!this->loadMovie(filename))
-      PRINTF(1)("MoviePlayer::loadMovie() failes for %s\n", filename);
-  }
-}
-
-MoviePlayer::MoviePlayer()
-{
-  this->init();
-}
+  // set the class id for the base object
+  this->setClassID(CL_MOVIE_PLAYER, "MoviePlayer");
+
+  status = STOP;
+  timer = 0;
+  frame_number = 0;
+
+  mediaLoaded = false;
+
+  this->loadMovie(filename);
+
+}
+
 
 MoviePlayer::~MoviePlayer()
 {
-  //delete material;
-  //delete model;
+  this->unloadMedia();
+}
+
+void MoviePlayer::unloadMedia()
+{
+  // check whether a movie is already loaded
+  if(!mediaLoaded)
+    return;
 
   if (glIsTexture(texture))
@@ -67,19 +73,27 @@
   // Close the video file
   av_close_input_file(format_context);
-}
-
-void MoviePlayer::init()
-{
-  // set the class id for the base object
-  this->setClassID(CL_MOVIE_PLAYER, "MoviePlayer");
 
   status = STOP;
   timer = 0;
   frame_number = 0;
-  loading = false;
-}
+
+  mediaLoaded = false;
+
+}
+
 
 bool MoviePlayer::loadMovie(const char* filename)
 {
+  this->unloadMedia();
+
+  if(filename == NULL)
+    return false;
+  // check whether file exists
+  if(!ResourceManager::isInDataDir(filename))
+  {
+    PRINTF(1)("Could not find %s\n", filename);
+    return false;
+  }
+
   // register all formats and codecs
   av_register_all();
@@ -164,5 +178,5 @@
   glBindTexture(GL_TEXTURE_2D, 0);
 
-  loading = true;
+  mediaLoaded = true;
   return true;
 }
@@ -264,5 +278,5 @@
 bool MoviePlayer::gotoFrame(int frames)
 {
-  if(!loading)
+  if(!mediaLoaded)
   {
     PRINTF(0)("Load first the media file with loadMovie\n");
@@ -390,5 +404,5 @@
 void MoviePlayer::printInformation()
 {
-  if(!loading)
+  if(!mediaLoaded)
   {
     PRINTF(0)("Load first the media file with loadMovie\n");
Index: branches/avi_play/src/lib/graphics/importer/movie_player.h
===================================================================
--- branches/avi_play/src/lib/graphics/importer/movie_player.h	(revision 6709)
+++ branches/avi_play/src/lib/graphics/importer/movie_player.h	(revision 6711)
@@ -54,10 +54,9 @@
   float fps;
   int duration;
-  bool loading;
+  bool mediaLoaded;
 
 public:
 
-  MoviePlayer(const char* filename);
-  MoviePlayer();
+  MoviePlayer(const char* filename = NULL);
   ~MoviePlayer();
 
@@ -79,9 +78,10 @@
 private:
 
-  void init();
   void getNextFrame();
   void skipFrame(int frames);
   bool gotoFrame(int frames);
 
+  void unloadMedia();
+
 };
 
