[vlc-devel] [PATCH] audio_output: ensure volume_set callback is set before calling

Tristan Matthews tmatth at videolan.org
Thu Mar 26 16:27:41 CET 2020


This fixes a crash when changing the volume while using the file aout module.
---
 src/audio_output/output.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/audio_output/output.c b/src/audio_output/output.c
index 472acc968f..76ef5f16ea 100644
--- a/src/audio_output/output.c
+++ b/src/audio_output/output.c
@@ -653,7 +653,7 @@ int aout_VolumeSet (audio_output_t *aout, float vol)
     int ret;
 
     vlc_mutex_lock(&owner->lock);
-    ret = aout->volume_set(aout, vol);
+    ret = aout->volume_set ? aout->volume_set(aout, vol) : -1;
     vlc_mutex_unlock(&owner->lock);
     return ret ? -1 : 0;
 }
-- 
2.20.1



More information about the vlc-devel mailing list