aboutsummaryrefslogtreecommitdiff
path: root/multimedia/obs-studio
diff options
context:
space:
mode:
authorChristoph Willing <chris.willing@linux.com>2018-12-07 20:33:02 +1000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2018-12-09 13:17:16 +0700
commitd915d0ddb2245452704d436be2eb8b270ac8e51f (patch)
treed091fef00247e59bc2cd80f7582470282f3d5b1b /multimedia/obs-studio
parent44fb375f655291e122d0d8136b8dd9763c1ac332 (diff)
multimedia/obs-studio: Patch for latest libfdk-aac api
Signed-off-by: Christoph Willing <chris.willing@linux.com>
Diffstat (limited to 'multimedia/obs-studio')
-rw-r--r--multimedia/obs-studio/libfdk-new-api.patch52
-rw-r--r--multimedia/obs-studio/obs-studio.SlackBuild3
2 files changed, 54 insertions, 1 deletions
diff --git a/multimedia/obs-studio/libfdk-new-api.patch b/multimedia/obs-studio/libfdk-new-api.patch
new file mode 100644
index 0000000000000..73329cf8040cb
--- /dev/null
+++ b/multimedia/obs-studio/libfdk-new-api.patch
@@ -0,0 +1,52 @@
+From 5cf2b5fbf925412620e2a40552d6348203851cb3 Mon Sep 17 00:00:00 2001
+From: pkviet <pkv.stream@gmail.com>
+Date: Thu, 29 Nov 2018 21:10:45 +0100
+Subject: [PATCH] obs-libfdk: Compatibility fix for new API
+
+fdk-aac v2.0.0 (aacenc 4.0.0) changes the AACENC_InfoStruct:
+the encoderDelay parameter is replaced by two, nDelay and
+nDelayCore. This patch checks the lib version and adjust the parameter
+accordingly.
+---
+ plugins/obs-libfdk/obs-libfdk.c | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/plugins/obs-libfdk/obs-libfdk.c b/plugins/obs-libfdk/obs-libfdk.c
+index d6eb496184..94b139de57 100644
+--- a/plugins/obs-libfdk/obs-libfdk.c
++++ b/plugins/obs-libfdk/obs-libfdk.c
+@@ -9,7 +9,6 @@
+
+ #include <fdk-aac/aacenc_lib.h>
+
+-
+ static const char *libfdk_get_error(AACENC_ERROR err)
+ {
+ switch(err) {
+@@ -224,7 +223,7 @@ static bool libfdk_encode(void *data, struct encoder_frame *frame,
+ void *in_ptr;
+ void *out_ptr;
+ AACENC_ERROR err;
+-
++ int64_t encoderDelay;
+
+ in_ptr = frame->data[0];
+ in_size = enc->frame_size_bytes;
+@@ -261,10 +260,13 @@ static bool libfdk_encode(void *data, struct encoder_frame *frame,
+ }
+
+ *received_packet = true;
+-
+- packet->pts = enc->total_samples -
+- enc->info.encoderDelay; // TODO: Just a guess, find out if that's actualy right
+- packet->dts = enc->total_samples - enc->info.encoderDelay;
++#if (AACENCODER_LIB_VL0 >= 4)
++ encoderDelay= enc->info.nDelay;
++#else
++ encoderDelay= enc->info.encoderDelay;
++#endif
++ packet->pts = enc->total_samples - encoderDelay;
++ packet->dts = enc->total_samples - encoderDelay;
+ packet->data = enc->packet_buffer;
+ packet->size = out_args.numOutBytes;
+ packet->type = OBS_ENCODER_AUDIO;
diff --git a/multimedia/obs-studio/obs-studio.SlackBuild b/multimedia/obs-studio/obs-studio.SlackBuild
index 8481166267b6b..e1f06990ac5c9 100644
--- a/multimedia/obs-studio/obs-studio.SlackBuild
+++ b/multimedia/obs-studio/obs-studio.SlackBuild
@@ -25,7 +25,7 @@
PRGNAM=obs-studio
VERSION=${VERSION:-22.0.3}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -63,6 +63,7 @@ cd $TMP
rm -rf $PRGNAM-$VERSION
tar xf $CWD/$PRGNAM-$VERSION.tar.gz || tar xf $CWD/$VERSION.tar.gz
cd $PRGNAM-$VERSION
+patch -p1 < $CWD/libfdk-new-api.patch
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \