From 000285ee8e077f5b0cd391ffc30cc71e5a3c728d Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 11 Dec 2015 20:51:32 +0100 Subject: mixer: fix volume initialization with --af=volume A manually added af_volume could lead to muted audio when switching to a new file. af_volume keeps the last volume set by AF_CONTROL_SET_VOLUME to return it with AF_CONTROL_GET_VOLUME, but the initial value is 0. So the mixer volume was forced to 0 when unintializing the filter chain and reading back the previously set volume. --- audio/mixer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/audio/mixer.c b/audio/mixer.c index 3aa06f6c62..deeea1b3e5 100644 --- a/audio/mixer.c +++ b/audio/mixer.c @@ -296,6 +296,8 @@ static void restore_volume(struct mixer *mixer) const char *prev_driver = mixer->driver; mixer->driver = mixer->softvol ? "softvol" : ao_get_name(ao); + if (!prev_driver[0]) + prev_driver = mixer->driver; // Restore old parameters if volume won't survive reinitialization. // But not if volume scale is possibly different. -- cgit v1.2.3