summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordavemds <dave@gurumeditation.it>2014-02-21 20:54:08 +0100
committerdavemds <dave@gurumeditation.it>2014-02-21 20:54:08 +0100
commit9b09d9bbbce8632e66e67cd7b28aae5c61288018 (patch)
treee4e233b506d3d7a694c149f512ee809876a352ed /src
parentfbfadc742e89ee10b19a92efc102f86d8e9e3531 (diff)
downloademotion_generic_players-9b09d9bbbce8632e66e67cd7b28aae5c61288018.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/vlc/emotion_generic_vlc.c12
1 files changed, 7 insertions, 5 deletions
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