[vlc-devel] commit: DBus: set volume on playlist ( Rémi Denis-Courmont )

git version control git at videolan.org
Thu Jul 9 21:15:12 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jul  9 22:12:35 2009 +0300| [f1330ca6339ed11540a73112ddde3862099de0dd] | committer: Rémi Denis-Courmont 

DBus: set volume on playlist

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f1330ca6339ed11540a73112ddde3862099de0dd
---

 modules/control/dbus.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules/control/dbus.c b/modules/control/dbus.c
index eb5f6cc..cba2ccd 100644
--- a/modules/control/dbus.c
+++ b/modules/control/dbus.c
@@ -236,8 +236,12 @@ DBUS_METHOD( VolumeGet )
     OUT_ARGUMENTS;
     dbus_int32_t i_dbus_vol;
     audio_volume_t i_vol;
+
     /* 2nd argument of aout_VolumeGet is int32 */
-    aout_VolumeGet( (vlc_object_t*) p_this, &i_vol );
+    playlist_t *p_playlist = pl_Hold( ((vlc_object_t*) p_this) );
+    aout_VolumeGet( p_playlist, &i_vol );
+    pl_Release( ((vlc_object_t*) p_this) );
+
     double f_vol = 100. * i_vol / AOUT_VOLUME_MAX;
     i_dbus_vol = round( f_vol );
     ADD_INT32( &i_dbus_vol );
@@ -268,8 +272,9 @@ DBUS_METHOD( VolumeSet )
 
     double f_vol = AOUT_VOLUME_MAX * i_dbus_vol / 100.;
     i_vol = round( f_vol );
-    aout_VolumeSet( (vlc_object_t*) p_this, i_vol );
-
+    playlist_t *p_playlist = pl_Hold( ((vlc_object_t*) p_this) );
+    aout_VolumeSet( p_playlist, i_vol );
+    pl_Release( ((vlc_object_t*) p_this) );
     REPLY_SEND;
 }
 




More information about the vlc-devel mailing list