summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libfaad2/local_changes.diff5
-rw-r--r--libfaad2/specrec.c3
2 files changed, 5 insertions, 3 deletions
diff --git a/libfaad2/local_changes.diff b/libfaad2/local_changes.diff
index 0e3fe95d41..db2b60cd68 100644
--- a/libfaad2/local_changes.diff
+++ b/libfaad2/local_changes.diff
@@ -360,7 +360,7 @@
}
#endif
-@@ -865,22 +842,13 @@
+@@ -865,22 +842,14 @@
/* always allocate 2 channels, PS can always "suddenly" turn up */
#if (defined(PS_DEC) || defined(DRM_PS))
@@ -373,7 +373,8 @@
- if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 0)
- {
- /* element_output_channels not set yet */
-+ if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] < output_channels) {
++ if (hDecoder->element_alloced[hDecoder->fr_ch_ele] == 0 ||
++ hDecoder->element_output_channels[hDecoder->fr_ch_ele] < output_channels) {
hDecoder->element_output_channels[hDecoder->fr_ch_ele] = output_channels;
- } else if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] != output_channels) {
- /* element inconsistency */
diff --git a/libfaad2/specrec.c b/libfaad2/specrec.c
index 1119dd3b53..d4d600916f 100644
--- a/libfaad2/specrec.c
+++ b/libfaad2/specrec.c
@@ -847,7 +847,8 @@ uint8_t reconstruct_single_channel(NeAACDecHandle hDecoder, ic_stream *ics,
output_channels = 1;
#endif
- if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] < output_channels) {
+ if (hDecoder->element_alloced[hDecoder->fr_ch_ele] == 0 ||
+ hDecoder->element_output_channels[hDecoder->fr_ch_ele] < output_channels) {
hDecoder->element_output_channels[hDecoder->fr_ch_ele] = output_channels;
retval = allocate_single_channel(hDecoder, sce->channel, output_channels);
if (retval > 0)