diff options
author | wm4 <wm4@nowhere> | 2015-12-11 20:51:32 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-12-11 20:52:37 +0100 |
commit | 000285ee8e077f5b0cd391ffc30cc71e5a3c728d (patch) | |
tree | 5e828164aef80d369a73ac0aed7270c8bc767943 /audio | |
parent | 67a4892ee3142e0dd6eacb82ee1b36c64c3ec711 (diff) | |
download | mpv-000285ee8e077f5b0cd391ffc30cc71e5a3c728d.tar.bz2 mpv-000285ee8e077f5b0cd391ffc30cc71e5a3c728d.tar.xz |
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.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/mixer.c | 2 |
1 files changed, 2 insertions, 0 deletions
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. |