Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
34c7c3de by Steve Lhomme at 2026-02-13T12:12:38+00:00
faad: don't patch channels with newer libraries
The 7.1 PCE mapping patch has been applied and is available since 2.10.1 [^1].
We can detect whether we build with 2.10.1 or newer by checking the presence of
the FAAD2_VERSION define in faad.h [^2]. Unfortunately it's a string so we can't
use the value.
[^1]:
https://github.com/knik0/faad2/commit/b9bd2eba31f09c48c507c3f1a4beba9727d89feb
[^2]:
https://github.com/knik0/faad2/commit/bc533c904317622d8b4ab243c2d9dfc17c5ef60a
- - - - -
3a1acd63 by Steve Lhomme at 2026-02-13T12:12:38+00:00
contrib: faad2: update to 2.11.2
It's now using CMake and integrates some of our patches.
We don't need to flag the version as patched anymore since 2.10.1.
Disabling DRC in now a build option.
- - - - -
f431ac1b by Steve Lhomme at 2026-02-13T12:12:38+00:00
faad: simplify PCA patch decision
The FAAD2_VIDEOLAN_PATCHED define doesn't exist anymore in our repository.
We only need to know about any version that's older than 2.10.1.
- - - - -
6 changed files:
- contrib/src/faad2/SHA512SUMS
- − contrib/src/faad2/faad2-add-define.patch
- − contrib/src/faad2/faad2-disable-drc.patch
- − contrib/src/faad2/faad2-fix-71wPCEmapping.patch
- contrib/src/faad2/rules.mak
- modules/codec/faad.c
Changes:
=====================================
contrib/src/faad2/SHA512SUMS
=====================================
@@ -1 +1 @@
-92c8b5e79f85b7a7caac9e7954959c26d74ef148a658dcb37e2c1b303fc2fcc5a0d12f21e7bd476870498109bdd03916a56c13f578186a69d6eceb103222e771
faad2-2_10_0.tar.gz
+fd140c0f4e7946e95a49a8652e26f33b138fc3375da34d5e3a55cdde8a74be429eb6fe0180bd434841022cee3c2ec65fe40dda7440fe0dd2761622174f992490
faad2-2.11.2.tar.gz
=====================================
contrib/src/faad2/faad2-add-define.patch deleted
=====================================
@@ -1,10 +0,0 @@
---- faad2/include/neaacdec.orig.h 2017-05-04 13:46:52.553943436 +0200
-+++ faad2/include/neaacdec.h 2017-05-04 13:46:47.667989456 +0200
-@@ -70,6 +70,7 @@
- #endif
-
- #define FAAD2_VERSION "unknown"
-+#define FAAD2_VIDEOLAN_PATCHED
-
- /* object types for AAC */
- #define MAIN 1
=====================================
contrib/src/faad2/faad2-disable-drc.patch deleted
=====================================
@@ -1,35 +0,0 @@
-diff -Naur faad2-2.7.orig/libfaad/specrec.c faad2-2.7/libfaad/specrec.c
---- faad2-2.7.orig/libfaad/specrec.c 2009-01-27 00:51:15.000000000 +0100
-+++ faad2-2.7/libfaad/specrec.c 2017-02-23 10:31:40.527397266 +0100
-@@ -1000,12 +1000,13 @@
- spec_coef, hDecoder->frameLength);
-
- /* drc decoding */
-+#if 0
- if (hDecoder->drc->present)
- {
- if (!hDecoder->drc->exclude_mask[sce->channel] ||
!hDecoder->drc->excluded_chns_present)
- drc_decode(hDecoder->drc, spec_coef);
- }
--
-+#endif
- /* filter bank */
- #ifdef SSR_DEC
- if (hDecoder->object_type != SSR)
-@@ -1241,6 +1242,7 @@
- spec_coef2, hDecoder->frameLength);
-
- /* drc decoding */
-+#if 0
- if (hDecoder->drc->present)
- {
- if (!hDecoder->drc->exclude_mask[cpe->channel] ||
!hDecoder->drc->excluded_chns_present)
-@@ -1248,7 +1250,7 @@
- if (!hDecoder->drc->exclude_mask[cpe->paired_channel] ||
!hDecoder->drc->excluded_chns_present)
- drc_decode(hDecoder->drc, spec_coef2);
- }
--
-+#endif
- /* filter bank */
- #ifdef SSR_DEC
- if (hDecoder->object_type != SSR)
=====================================
contrib/src/faad2/faad2-fix-71wPCEmapping.patch deleted
=====================================
@@ -1,39 +0,0 @@
---- 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)
- {
=====================================
contrib/src/faad2/rules.mak
=====================================
@@ -1,8 +1,7 @@
# faad2
-FAAD2_VERSION := 2.10.0
-FAAD2_VERSION_FIXED := $(subst .,_,$(FAAD2_VERSION))
-FAAD2_URL := $(GITHUB)/knik0/faad2/archive/$(FAAD2_VERSION_FIXED).tar.gz
+FAAD2_VERSION := 2.11.2
+FAAD2_URL := $(GITHUB)/knik0/faad2/archive/refs/tags/$(FAAD2_VERSION).tar.gz
ifeq ($(findstring $(ARCH),arm),)
# FAAD is a lot slower than lavc on ARM. Skip it.
@@ -11,32 +10,25 @@ PKGS += faad2
endif
endif
-$(TARBALLS)/faad2-$(FAAD2_VERSION_FIXED).tar.gz:
+$(TARBALLS)/faad2-$(FAAD2_VERSION).tar.gz:
$(call download_pkg,$(FAAD2_URL),faad2)
-.sum-faad2: faad2-$(FAAD2_VERSION_FIXED).tar.gz
+.sum-faad2: faad2-$(FAAD2_VERSION).tar.gz
-faad2: faad2-$(FAAD2_VERSION_FIXED).tar.gz .sum-faad2
+faad2: faad2-$(FAAD2_VERSION).tar.gz .sum-faad2
$(UNPACK)
- # $(call update_autoconfig,.)
ifndef HAVE_FPU
$(APPLY) $(SRC)/faad2/faad2-fixed.patch
endif
- $(APPLY) $(SRC)/faad2/faad2-disable-drc.patch
- $(APPLY) $(SRC)/faad2/faad2-fix-71wPCEmapping.patch
- $(APPLY) $(SRC)/faad2/faad2-add-define.patch
- cd $(UNPACK_DIR) && $(CC) -iquote . -E - </dev/null || sed -i
's/-iquote /-I/' libfaad/Makefile.am
+ $(call pkg_static,"libfaad/faad2.pc.in")
$(MOVE)
-FAAD2_CONF := --without-drm
+FAAD2_CONF := -DFAAD_APPLY_DRC=OFF -DFAAD_BUILD_CLI=OFF
-.faad2: faad2
+.faad2: faad2 toolchain.cmake
$(REQUIRE_GPL)
- $(RECONF)
- $(MAKEBUILDDIR)
- $(MAKECONFIGURE) $(FAAD2_CONF)
- sed -i.orig "s/shrext_cmds/shrext/g" $(BUILD_DIR)/libtool
- $(call pkg_static,"$(BUILD_DIRUNPACK)/libfaad/faad2.pc")
- +$(MAKEBUILD) -C libfaad
- +$(MAKEBUILD) -C libfaad install
+ $(CMAKECLEAN)
+ $(HOSTVARS_CMAKE) $(CMAKE) $(FAAD2_CONF)
+ +$(CMAKEBUILD)
+ $(CMAKEINSTALL)
touch $@
=====================================
modules/codec/faad.c
=====================================
@@ -43,6 +43,11 @@
#include <vlc_cpu.h>
#include <vlc_aout.h>
+#include <faad.h>
+#if !defined(FAAD2_VERSION) // FAAD2_VERSION added in 2.10.1
+# define PATCH_PCA
+#endif
+
#include <neaacdec.h>
#include "../packetizer/mpeg4audio.h"
@@ -454,7 +459,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
p_sys->b_ps = frame.ps;
}
-#ifndef FAAD2_VIDEOLAN_PATCHED
+#ifdef PATCH_PCA
/* PS Enabled FAAD PCA bug hotfix (contribs has patch) */
if( frame.channels == 8 )
{
@@ -650,4 +655,3 @@ static void DoReordering( uint32_t *p_out, uint32_t *p_in,
int i_samples,
}
}
}
-
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/compare/1df083f54c8df7c849457944287cd742f770a9fc...f431ac1b58356fc97e6564adf14243d1b3fdbbbf
--
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/compare/1df083f54c8df7c849457944287cd742f770a9fc...f431ac1b58356fc97e6564adf14243d1b3fdbbbf
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits