summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavemds <dave@gurumeditation.it>2014-02-22 12:12:12 +0100
committerdavemds <dave@gurumeditation.it>2014-02-22 12:12:12 +0100
commit41c5d5039cbaa9484352d41f6f95dac602ddecad (patch)
treebdfe84568467216eb97411ff6d49f9b3aea16c0e
parentdb1eacf2fc7b848553491001b0f4cb2543feaf92 (diff)
downloademotion_generic_players-41c5d5039cbaa9484352d41f6f95dac602ddecad.tar.gz
Emotion VLC: defer the resource free until the video is actually stopped.
Fix vlc complainig on shutdown.
-rw-r--r--src/vlc/emotion_generic_vlc.c29
1 files 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