From 9b09d9bbbce8632e66e67cd7b28aae5c61288018 Mon Sep 17 00:00:00 2001 From: davemds Date: Fri, 21 Feb 2014 20:54:08 +0100 Subject: Emotion VLC: fix the volume/mute bug. Set again the volume and the mute state every time the video start to play, this fix the setting of the volume/mute before the complete loading of the file. --- src/vlc/emotion_generic_vlc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/vlc/emotion_generic_vlc.c b/src/vlc/emotion_generic_vlc.c index 069d04b..fbc8bb3 100644 --- a/src/vlc/emotion_generic_vlc.c +++ b/src/vlc/emotion_generic_vlc.c @@ -48,6 +48,8 @@ struct _App { Ecore_Pipe *fd_write; // write commands for emotion here int opening; int playing; + int volume; + Eina_Bool audio_muted; int last_order; @@ -223,6 +225,8 @@ _event_cb(const struct libvlc_event_t *ev, void *data) break; case libvlc_MediaPlayerPlaying: DBG("libvlc_MediaPlayerPlaying"); + libvlc_audio_set_volume(app->mp, app->volume); + libvlc_audio_set_mute(app->mp, app->audio_muted); _send_cmd(app, EM_RESULT_PLAYBACK_STARTED); break; case libvlc_MediaPlayerStopped: @@ -466,21 +470,19 @@ _mute_set(App *app, int mute) if (!app->mp) return; + app->audio_muted = mute; libvlc_audio_set_mute(app->mp, mute); } static void _volume_set(App *app, float volume) { - int vol; - DBG("Volume set %.2f", volume); if (!app->mp) return; - vol = volume * 100; - - libvlc_audio_set_volume(app->mp, vol); + app->volume = volume * 100; + libvlc_audio_set_volume(app->mp, app->volume); } static void -- cgit v1.2.1