diff --git a/include/vlc_aout_intf.h b/include/vlc_aout_intf.h index b31d9803de21065f6d83c33cfce23b02ddf99b71..e889ef1d263244e3b0b915090974f868e04d2c90 100644 --- a/include/vlc_aout_intf.h +++ b/include/vlc_aout_intf.h @@ -38,7 +38,8 @@ VLC_API int aout_VolumeUp( vlc_object_t *, int, audio_volume_t * ); #define aout_VolumeDown(a, b, c) aout_VolumeUp(a, -(b), c) VLC_API int aout_MuteToggle( vlc_object_t * ); #define aout_MuteToggle(a) aout_MuteToggle(VLC_OBJECT(a)) -VLC_API int aout_SetMute( vlc_object_t *, audio_volume_t *, bool ); +VLC_API int aout_MuteSet( vlc_object_t *, bool ); +#define aout_MuteSet(a, b) aout_MuteSet(VLC_OBJECT(a), b) VLC_API bool aout_IsMuted( vlc_object_t * ); VLC_API void aout_EnableFilter( vlc_object_t *, const char *, bool ); diff --git a/lib/audio.c b/lib/audio.c index 7a5a288ed2d9f9e31d8ce5508c0a712330ddf9b8..91e96b12cc136b54795777da9a7045250ad0b769 100644 --- a/lib/audio.c +++ b/lib/audio.c @@ -323,7 +323,7 @@ int libvlc_audio_get_mute( libvlc_media_player_t *mp ) void libvlc_audio_set_mute( libvlc_media_player_t *mp, int mute ) { - aout_SetMute( VLC_OBJECT(mp), NULL, !!mute ); + aout_MuteSet( VLC_OBJECT(mp), mute != 0 ); } /***************************************************************************** diff --git a/modules/gui/qt4/components/controller_widget.cpp b/modules/gui/qt4/components/controller_widget.cpp index 7f973c0a15e21638bfbe1006048709d24b83a454..25163cdc101d66bcb47debc776ab335154c118ea 100644 --- a/modules/gui/qt4/components/controller_widget.cpp +++ b/modules/gui/qt4/components/controller_widget.cpp @@ -204,7 +204,7 @@ void SoundWidget::setMuted( bool mute ) { b_is_muted = mute; playlist_t *p_playlist = pl_Get( p_intf ); - aout_SetMute( VLC_OBJECT(p_playlist), NULL, mute ); + aout_MuteSet( VLC_OBJECT(p_playlist), mute ); } bool SoundWidget::eventFilter( QObject *obj, QEvent *e ) diff --git a/src/audio_output/intf.c b/src/audio_output/intf.c index 7f61e7bcbe18f84d275fceabede6ee0ccdefc7a7..1182ea6ff8ee93b70c19de0ce3b174db5ae468f6 100644 --- a/src/audio_output/intf.c +++ b/src/audio_output/intf.c @@ -187,6 +187,7 @@ int aout_VolumeUp (vlc_object_t *obj, int value, audio_volume_t *volp) int aout_MuteToggle (vlc_object_t *obj) { audio_output_t *aout; + float vol; bool mute; prepareVolume (obj, &aout, &vol, &mute); @@ -207,20 +208,17 @@ bool aout_IsMuted (vlc_object_t *obj) return mute; } +#undef aout_MuteSet /** * Sets mute status. */ -int aout_SetMute (vlc_object_t *obj, audio_volume_t *volp, bool mute) +int aout_MuteSet (vlc_object_t *obj, bool mute) { audio_output_t *aout; - int ret; float vol; prepareVolume (obj, &aout, &vol, NULL); - ret = commitVolume (obj, aout, vol, mute); - if (volp != NULL) - *volp = mute ? 0 : lroundf (vol * AOUT_VOLUME_DEFAULT); - return ret; + return commitVolume (obj, aout, vol, mute); } diff --git a/src/libvlccore.sym b/src/libvlccore.sym index 6e8c49e6deb553aba392daac5f62e6815bdbe292..45c8494dbc91633425a8e0990ac1e55e2bad4fb3 100644 --- a/src/libvlccore.sym +++ b/src/libvlccore.sym @@ -18,8 +18,8 @@ aout_VolumeGet aout_VolumeSet aout_VolumeUp aout_MuteToggle +aout_MuteSet aout_IsMuted -aout_SetMute aout_VolumeSoftInit aout_VolumeHardInit block_Alloc