[vlc-commits] opensles: do not set volume if aout start failed

Rafaël Carré git at videolan.org
Sat Jun 8 13:18:03 CEST 2013


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sat Jun  8 13:08:49 2013 +0200| [a62d119ac4cc1f48f53d649fa75d260a8d7fbf04] | committer: Rafaël Carré

opensles: do not set volume if aout start failed

Close: #8579

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

 modules/audio_output/opensles_android.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/audio_output/opensles_android.c b/modules/audio_output/opensles_android.c
index 73bdac2..cf6e9c5 100644
--- a/modules/audio_output/opensles_android.c
+++ b/modules/audio_output/opensles_android.c
@@ -202,6 +202,9 @@ static void Flush(audio_output_t *aout, bool drain)
 
 static int VolumeSet(audio_output_t *aout, float vol)
 {
+    if (!aout->sys->volumeItf)
+        return -1;
+
     /* Convert UI volume to linear factor (cube) */
     vol = vol * vol * vol;
 
@@ -218,6 +221,9 @@ static int VolumeSet(audio_output_t *aout, float vol)
 
 static int MuteSet(audio_output_t *aout, bool mute)
 {
+    if (!aout->sys->volumeItf)
+        return -1;
+
     SLresult r = SetMute(aout->sys->volumeItf, mute);
     return (r == SL_RESULT_SUCCESS) ? 0 : -1;
 }



More information about the vlc-commits mailing list