Skip to content

Commit

Permalink
Work around libbluray build issues due to ffmpeg changiing a functio …
Browse files Browse the repository at this point in the history
…so the name clashes with libbluray
  • Loading branch information
Vargol committed Mar 23, 2024
1 parent adad1ce commit 8ba3a59
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build/build-ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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}

Expand Down
6 changes: 6 additions & 0 deletions build/build-libbluray.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
39 changes: 39 additions & 0 deletions build/libblu_dec_init.patch
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 8ba3a59

Please sign in to comment.