diff options
author | Rafael Antognolli <antognolli@gmail.com> | 2012-03-23 19:42:38 +0000 |
---|---|---|
committer | Rafael Antognolli <antognolli@gmail.com> | 2012-03-23 19:42:38 +0000 |
commit | a057a1656a0b522692d785575a37cba40a95cbd4 (patch) | |
tree | 147201c8e08d1f97a98f89a030d290ce6925b78d /src | |
parent | 8e2f062caf0dd750ffb4631be795b62bc58cdfb5 (diff) | |
download | emotion_generic_players-a057a1656a0b522692d785575a37cba40a95cbd4.tar.gz |
emotion/generic-vlc: Don't try to stop the player from event thread.
Must send the command through the pipe so the main thread can stop it.
SVN revision: 69591
Diffstat (limited to 'src')
-rw-r--r-- | src/vlc/emotion_generic_vlc.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/vlc/emotion_generic_vlc.c b/src/vlc/emotion_generic_vlc.c index feecac3..266ae65 100644 --- a/src/vlc/emotion_generic_vlc.c +++ b/src/vlc/emotion_generic_vlc.c @@ -23,6 +23,7 @@ enum _Thread_Events { EM_THREAD_POSITION_CHANGED, + EM_THREAD_PLAYBACK_STOPPED, EM_THREAD_LAST }; @@ -367,7 +368,8 @@ _event_cb(const struct libvlc_event_t *ev, void *data) _send_file_set(app); break; case libvlc_MediaPlayerEndReached: - _send_cmd(app, EM_RESULT_PLAYBACK_STOPPED); + thread_event = EM_THREAD_PLAYBACK_STOPPED; + write(app->fd_write, &thread_event, sizeof(thread_event)); break; } } @@ -718,6 +720,11 @@ _process_thread_events(struct _App *app) case EM_THREAD_POSITION_CHANGED: _position_changed(app); break; + case EM_THREAD_PLAYBACK_STOPPED: + libvlc_media_player_stop(app->mp); + app->playing = 0; + _send_cmd(app, EM_RESULT_PLAYBACK_STOPPED); + break; } } |