summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavemds <dave@gurumeditation.it>2014-02-22 13:03:52 +0100
committerdavemds <dave@gurumeditation.it>2014-02-22 13:03:52 +0100
commitdf66faba5699a59d1211f65867e217d2c47d5919 (patch)
treea5eaf413ea70b68e251dd87df0a5cd5fe229d37f
parentc8fc9347c955b96a8542a68ce928c8ab27df795a (diff)
downloademotion_generic_players-df66faba5699a59d1211f65867e217d2c47d5919.tar.gz
Emotion VLC: fix send position_change while paused.
VLC does not emit the TimeChanged event while the video is paused, so if the user change position while paused emotion is not aware of the change. This commit force the event to emotion if the video is paused
-rw-r--r--src/vlc/emotion_generic_vlc.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/vlc/emotion_generic_vlc.c b/src/vlc/emotion_generic_vlc.c
index fb0d0ca..02d25ec 100644
--- a/src/vlc/emotion_generic_vlc.c
+++ b/src/vlc/emotion_generic_vlc.c
@@ -94,13 +94,15 @@ _send_file_closed(App *app)
}
static void
-_send_time_changed(App *app, const struct libvlc_event_t *ev)
+_send_time_changed(App *app)
{
- float new_time = ev->u.media_player_time_changed.new_time;
+ float new_time;
- new_time /= 1000;
if (app->vs->frame_drop > 1)
return;
+
+ new_time = libvlc_media_player_get_time(app->mp);
+ new_time /= 1000;
_send_cmd(app, EM_RESULT_POSITION_CHANGED);
SEND_CMD_PARAM(app, new_time);
}
@@ -215,7 +217,7 @@ _event_cb(const struct libvlc_event_t *ev, void *data)
{
case libvlc_MediaPlayerTimeChanged:
// DBG("libvlc_MediaPlayerTimeChanged");
- _send_time_changed(app, ev);
+ _send_time_changed(app);
break;
case libvlc_MediaPlayerLengthChanged:
DBG("libvlc_MediaPlayerLengthChanged");
@@ -460,12 +462,15 @@ _position_set(App *app, float position)
{
libvlc_time_t new_time;
- DBG("Posistion set %.3f", position);
+ DBG("Position set %.3f", position);
if (!app->mp)
return;
new_time = position * 1000;
libvlc_media_player_set_time(app->mp, new_time);
+
+ if (libvlc_media_player_get_state(app->mp) == libvlc_Paused)
+ _send_time_changed(app);
}
static void