GNOME Bugzilla – Bug 675451
a52dec: can update caps if original number of audio channels has changed
Last modified: 2012-05-17 11:18:34 UTC
Created attachment 213451 [details] [review] can update caps if original number of channels has changed If the number of channels is changing, then a52dec should give a chance to retrieve the orignal channels. For exemple, if there are 2 audio channels and some minutes later, there are 6 audio channels in the ac3 packets, then the actual a52dec downmix from 6 to 2 audio channels. The patch allows to update caps if original number of channels has changed.
The patch looks wrong, it compares flags against using_channels, it should probably only compare the flags related to the channels. the code around there is also a bit hard to follow.
(In reply to comment #1) > The patch looks wrong, it compares flags against using_channels, it should > probably only compare the flags related to the channels. the code around there > is also a bit hard to follow. In the original code, some lines later there is: flags = a52dec->using_channels; and also: channels = flags & (A52_CHANNEL_MASK | A52_LFE); ... a52dec->using_channels = channels; So should I use: if (a52dec->using_channels != flags & (A52_CHANNEL_MASK | A52_LFE)) { instead of: if (a52dec->using_channels != flags) { ?
In addition to the mask the test should also not be against using_channels (which specifies the current output), but rather stream_channels (which tracks the input stream channels). The original patch would repeatedly renegotiate if e.g. downstream could only handle 2 channels (using_channels) of the 6 input channels (stream_channels). [0.10] commit 98b8c1ce564705ea9370d9cb453f4075a407a03b Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> Date: Thu May 17 12:40:05 2012 +0200 a52dec: trigger renegotiation upon changed stream channels Fixes #675451 [0.11] commit 4d97760993ddef99175f1dc2bcf1444fcd1943f9 Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> Date: Thu May 17 12:40:05 2012 +0200 a52dec: trigger renegotiation upon changed stream channels Fixes #675451