davemds pushed a commit to branch master.

http://git.enlightenment.org/core/emotion_generic_players.git/commit/?id=41c5d5039cbaa9484352d41f6f95dac602ddecad

commit 41c5d5039cbaa9484352d41f6f95dac602ddecad
Author: davemds <d...@gurumeditation.it>
Date:   Sat Feb 22 12:12:12 2014 +0100

    Emotion VLC: defer the resource free until the video is actually stopped.
    
    Fix vlc complainig on shutdown.
---
 src/vlc/emotion_generic_vlc.c | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/src/vlc/emotion_generic_vlc.c b/src/vlc/emotion_generic_vlc.c
index f15d718..70a8255 100644
--- a/src/vlc/emotion_generic_vlc.c
+++ b/src/vlc/emotion_generic_vlc.c
@@ -47,6 +47,7 @@ struct _App {
    Ecore_Pipe *fd_read;  // read commands from emotion here
    Ecore_Pipe *fd_write; // write commands for emotion here
    int opening;
+   int closing;
    int playing;
    int volume;
    Eina_Bool audio_muted;
@@ -233,6 +234,21 @@ _event_cb(const struct libvlc_event_t *ev, void *data)
       case libvlc_MediaPlayerStopped:
          DBG("libvlc_MediaPlayerStopped");
          _send_cmd(app, EM_RESULT_PLAYBACK_STOPPED);
+         if (app->closing)
+           {
+              free(app->filename);
+              app->filename = NULL;
+              free(app->subtitle_path);
+              app->subtitle_path = NULL;
+              libvlc_media_release(app->m);
+              app->m = NULL;
+              libvlc_media_player_release(app->mp);
+              app->mp = NULL;
+              emotion_generic_shm_free(app->vs);
+              app->playing = 0;
+              app->closing = 0;
+              _send_file_closed(app);
+           }
          break;
       case libvlc_MediaPlayerEndReached:
          DBG("libvlc_MediaPlayerEndReached");
@@ -402,19 +418,8 @@ _file_close(App *app)
    if (!app->mp)
      return;
 
-   app->playing = 0;
+   app->closing = 1;
    libvlc_media_player_stop(app->mp);
-
-   free(app->filename);
-   free(app->subtitle_path);
-   if (app->mp)
-     {
-        libvlc_media_release(app->m);
-        libvlc_media_player_release(app->mp);
-     }
-   emotion_generic_shm_free(app->vs);
-
-   _send_file_closed(app);
 }
 
 static void

-- 


Reply via email to