summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRafael Antognolli <antognolli@gmail.com>2011-09-05 13:11:53 +0000
committerRafael Antognolli <antognolli@gmail.com>2011-09-05 13:11:53 +0000
commitee9319248b1191879b245c12b23d33758bd05b7f (patch)
tree28269cd26f3e8d039a51272a064aad2c31f2edeb /src
parent7ed3fcc96b500d8b7ae23308cb74579512415142 (diff)
downloademotion_generic_players-ee9319248b1191879b245c12b23d33758bd05b7f.tar.gz
emotion/generic: Add return value to EM_RESULT_FILE_SET_DONE.
It now checks if was possible to get the shared memory, and returns true or false. This will command will also be used later to return false for file opening no matter what was the problem, and maybe the int parameter will indicate the type of error. SVN revision: 63197
Diffstat (limited to 'src')
-rw-r--r--src/vlc/emotion_generic_vlc.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/vlc/emotion_generic_vlc.c b/src/vlc/emotion_generic_vlc.c
index a9b8fd7..0df7c00 100644
--- a/src/vlc/emotion_generic_vlc.c
+++ b/src/vlc/emotion_generic_vlc.c
@@ -471,12 +471,27 @@ _audio_track_set(struct _App *app)
static void
_file_set_done(struct _App *app)
{
- emotion_generic_shm_get(app->shmname, &app->vs, &app->vf);
+ int r;
+
+ app->opening = 0;
+
+ r = emotion_generic_shm_get(app->shmname, &app->vs, &app->vf);
+ if (!r)
+ {
+ free(app->filename);
+ libvlc_media_release(app->m);
+ libvlc_media_player_release(app->mp);
+ app->filename = NULL;
+ app->m = NULL;
+ app->mp = NULL;
+ _send_cmd_start(EM_RESULT_FILE_SET_DONE);
+ SEND_CMD_PARAM(r);
+ _send_cmd_finish();
+ }
app->w = app->vs->width;
app->h = app->vs->height;
libvlc_video_set_format(app->mp, "RV32", app->w, app->h, app->w * 4);
libvlc_video_set_callbacks(app->mp, _lock, _unlock, _display, app);
- app->opening = 0;
libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerPlaying,
@@ -489,7 +504,10 @@ _file_set_done(struct _App *app)
_event_cb, app);
libvlc_audio_set_mute(app->mp, 0);
- _send_cmd(EM_RESULT_FILE_SET_DONE);
+
+ _send_cmd_start(EM_RESULT_FILE_SET_DONE);
+ SEND_CMD_PARAM(r);
+ _send_cmd_finish();
}
static void