[vlc-commits] contribs: faad2: fix 7.1 channels detection
Francois Cartegnie
git at videolan.org
Tue Feb 28 21:19:08 CET 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Feb 28 21:16:12 2017 +0100| [297c8bbfdf193d077d2749d3716aba44d234728d] | committer: Francois Cartegnie
contribs: faad2: fix 7.1 channels detection
refs AAC 7.1 (channel_configuration 0 + PCE, 3 front, 2 side, 2 back, lfe).mp4
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=297c8bbfdf193d077d2749d3716aba44d234728d
---
contrib/src/faad2/faad2-fix-71wPCEmapping.patch | 39 +++++++++++++++++++++++++
contrib/src/faad2/rules.mak | 1 +
2 files changed, 40 insertions(+)
diff --git a/contrib/src/faad2/faad2-fix-71wPCEmapping.patch b/contrib/src/faad2/faad2-fix-71wPCEmapping.patch
new file mode 100644
index 0000000..c0bf385
--- /dev/null
+++ b/contrib/src/faad2/faad2-fix-71wPCEmapping.patch
@@ -0,0 +1,39 @@
+--- faad2-2.7/libfaad/decoder.c 2009-02-05 01:51:03.000000000 +0100
++++ faad2/libfaad/decoder.c 2017-02-28 21:14:46.946234869 +0100
+@@ -589,24 +589,30 @@
+ if (hDecoder->pce_set)
+ {
+ uint8_t i, chpos = 0;
+- uint8_t chdir, back_center = 0;
++ uint8_t chdir, back_center = 0, total = 0;
+
+ hInfo->num_front_channels = hDecoder->pce.num_front_channels;
++ total += hInfo->num_front_channels;
+ hInfo->num_side_channels = hDecoder->pce.num_side_channels;
++ total += hInfo->num_side_channels;
+ hInfo->num_back_channels = hDecoder->pce.num_back_channels;
++ total += hInfo->num_back_channels;
+ hInfo->num_lfe_channels = hDecoder->pce.num_lfe_channels;
++ total += hInfo->num_lfe_channels;
+
+ chdir = hInfo->num_front_channels;
+ if (chdir & 1)
+ {
+ #if (defined(PS_DEC) || defined(DRM_PS))
+- /* When PS is enabled output is always stereo */
+- hInfo->channel_position[chpos++] = FRONT_CHANNEL_LEFT;
+- hInfo->channel_position[chpos++] = FRONT_CHANNEL_RIGHT;
+-#else
++ if( total == 1 )
++ {
++ /* When PS is enabled output is always stereo */
++ hInfo->channel_position[chpos++] = FRONT_CHANNEL_LEFT;
++ hInfo->channel_position[chpos++] = FRONT_CHANNEL_RIGHT;
++ } else
++#endif
+ hInfo->channel_position[chpos++] = FRONT_CHANNEL_CENTER;
+ chdir--;
+-#endif
+ }
+ for (i = 0; i < chdir; i += 2)
+ {
diff --git a/contrib/src/faad2/rules.mak b/contrib/src/faad2/rules.mak
index 86ee035..f07f01d 100644
--- a/contrib/src/faad2/rules.mak
+++ b/contrib/src/faad2/rules.mak
@@ -21,6 +21,7 @@ ifndef HAVE_FPU
$(APPLY) $(SRC)/faad2/faad2-fixed.patch
endif
$(APPLY) $(SRC)/faad2/faad2-disable-drc.patch
+ $(APPLY) $(SRC)/faad2/faad2-fix-71wPCEmapping.patch
cd $(UNPACK_DIR) && $(CC) -iquote . -E - </dev/null || sed -i 's/-iquote /-I/' libfaad/Makefile.am
$(MOVE)
More information about the vlc-commits
mailing list