From 8ba3a593174ca24ca201da97dcdcd52b4e063afd Mon Sep 17 00:00:00 2001 From: David Burnett Date: Sat, 23 Mar 2024 13:25:58 +0000 Subject: [PATCH] Work around libbluray build issues due to ffmpeg changiing a functio so the name clashes with libbluray --- build/build-ffmpeg.sh | 6 +++--- build/build-libbluray.sh | 6 ++++++ build/libblu_dec_init.patch | 39 +++++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 build/libblu_dec_init.patch diff --git a/build/build-ffmpeg.sh b/build/build-ffmpeg.sh index c3fb616..a86f573 100755 --- a/build/build-ffmpeg.sh +++ b/build/build-ffmpeg.sh @@ -57,7 +57,7 @@ configure_build () { checkStatus $? "change directory failed" # prepare build - FF_FLAGS="-L${3}/lib -I${3}/include" + FF_FLAGS="-L${3}/lib -I${3}/include " export LDFLAGS="$FF_FLAGS" export CFLAGS="$FF_FLAGS" @@ -78,8 +78,8 @@ configure_build () { ./configure --prefix="$4" --enable-gpl --pkg-config-flags="--static" --pkg-config=$3/bin/pkg-config \ --enable-libaom --enable-libopenh264 --enable-libx264 --enable-libx265 --enable-libvpx \ --enable-libmp3lame --enable-libopus --enable-neon --enable-runtime-cpudetect \ - --enable-audiotoolbox --enable-videotoolbox --enable-libvorbis --enable-libsvtav1 \ - --enable-libsrt --enable-libwebp --enable-libbluray \ + --enable-audiotoolbox --enable-videotoolbox --enable-libvorbis \ + --enable-libsrt --enable-libwebp --enable-libbluray --enable-libsvtav1 \ --enable-libass --enable-nonfree --enable-libfdk-aac --enable-opencl ${FFMPEG_EXTRAS} # --enable-libass --enable-lto --enable-nonfree --enable-libfdk-aac --enable-opencl ${FFMPEG_EXTRAS} diff --git a/build/build-libbluray.sh b/build/build-libbluray.sh index d603da4..212fe1b 100755 --- a/build/build-libbluray.sh +++ b/build/build-libbluray.sh @@ -40,6 +40,12 @@ download_code () { configure_build () { + cd "$2/${SOFTWARE}/${SOFTWARE}/" + checkStatus $? "change directory failed" + git apply $1/libblu_dec_init.patch + checkStatus $? "git apply patch failed" + + cd "$2/${SOFTWARE}/build-${SOFTWARE}/" checkStatus $? "change directory failed" diff --git a/build/libblu_dec_init.patch b/build/libblu_dec_init.patch new file mode 100644 index 0000000..4a6e14f --- /dev/null +++ b/build/libblu_dec_init.patch @@ -0,0 +1,39 @@ +diff --git a/src/libbluray/disc/dec.c b/src/libbluray/disc/dec.c +index 73f64a37..17287520 100644 +--- a/src/libbluray/disc/dec.c ++++ b/src/libbluray/disc/dec.c +@@ -284,7 +284,7 @@ static void _dec_load(BD_DEC *dec, BD_ENC_INFO *i) + * + */ + +-BD_DEC *dec_init(struct dec_dev *dev, BD_ENC_INFO *enc_info, ++BD_DEC *lbr_dec_init(struct dec_dev *dev, BD_ENC_INFO *enc_info, + const char *keyfile_path, + void *regs, void *psr_read, void *psr_write) + { +diff --git a/src/libbluray/disc/dec.h b/src/libbluray/disc/dec.h +index d1329be2..cb1e3e92 100644 +--- a/src/libbluray/disc/dec.h ++++ b/src/libbluray/disc/dec.h +@@ -45,7 +45,7 @@ struct dec_dev { + + typedef struct bd_dec BD_DEC; + +-BD_PRIVATE BD_DEC *dec_init(struct dec_dev *dev, ++BD_PRIVATE BD_DEC *lbr_dec_init(struct dec_dev *dev, + struct bd_enc_info *enc_info, + const char *keyfile_path, + void *regs, void *psr_read, void *psr_write); +diff --git a/src/libbluray/disc/disc.c b/src/libbluray/disc/disc.c +index d5e39c49..bb0e3a09 100644 +--- a/src/libbluray/disc/disc.c ++++ b/src/libbluray/disc/disc.c +@@ -348,7 +348,7 @@ BD_DISC *disc_open(const char *device_path, + } + + struct dec_dev dev = { p->fs_handle, p->pf_file_open_bdrom, p, (file_openFp)disc_open_path, p->disc_root, device_path }; +- p->dec = dec_init(&dev, enc_info, keyfile_path, regs, psr_read, psr_write); ++ p->dec = lbr_dec_init(&dev, enc_info, keyfile_path, regs, psr_read, psr_write); + + return p; + }