af: fix crash when trying to use volume controls with AC3 pass-through
commit8a6b0b813a1431ca50986c90d97b72fa6640dbea
authorwm4 <wm4@mplayer2.org>
Sat, 14 Jan 2012 08:06:16 +0000 (14 09:06 +0100)
committerUoti Urpala <uau@mplayer2.org>
Fri, 9 Mar 2012 18:48:54 +0000 (9 20:48 +0200)
tree517f7d5ccb31266de04ed8dd4ee10ffee75e9855
parent1f6ba56d6ab699f5a6137a176f8183c82046be43
af: fix crash when trying to use volume controls with AC3 pass-through

Changing the volume when softvol is enabled or if the audio output driver
doesn't support volume controls causes insertion of the "volume" filter.
This fails with AC3. Since the filter wasn't removed after that, and the
filter chain was in a bogus state, random crashes occured past this
point.

Fix it by reinitializing the filter chain completely on failure. Volume
controls simply won't work. (This can't be fixed, because AC3 is a
compressed format, and would require additional decoding/encoding passes
in order to support arbitrary volume changes.)

This also affects balance controls.
libaf/af.c