aboutsummaryrefslogtreecommitdiffstats
path: root/testing/motion
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-11-01 11:35:34 -0400
committerNatanael Copa <ncopa@alpinelinux.org>2018-11-07 16:46:17 +0000
commita99473742ac3c4359d57be74da5f8334a3a87fb4 (patch)
tree17c381c354118faaf57cb6729091d30fc310ab01 /testing/motion
parent5870aa911f41349bc815ab697af1753f047a4323 (diff)
downloadaports-a99473742ac3c4359d57be74da5f8334a3a87fb4.tar.bz2
aports-a99473742ac3c4359d57be74da5f8334a3a87fb4.tar.xz
testing/motion: patch for ffmpeg 4
Diffstat (limited to 'testing/motion')
-rw-r--r--testing/motion/APKBUILD7
-rw-r--r--testing/motion/ffmpeg4.patch43
2 files changed, 48 insertions, 2 deletions
diff --git a/testing/motion/APKBUILD b/testing/motion/APKBUILD
index ec74858b84..f4b3036c15 100644
--- a/testing/motion/APKBUILD
+++ b/testing/motion/APKBUILD
@@ -4,7 +4,7 @@
# Maintainer: Mika Havela <mika.havela@gmail.com>
pkgname=motion
pkgver=4.1.1
-pkgrel=0
+pkgrel=1
pkgdesc="Detect if a significant part of the picture has changed (e.g. from a webcam)."
url="https://motion-project.github.io"
arch="all"
@@ -17,10 +17,12 @@ depends_dev=""
makedepends="$depends_dev autoconf automake bash jpeg-dev v4l-utils-dev linux-headers ffmpeg-dev"
install="$pkgname.pre-install"
subpackages="$pkgname-doc"
+# ffmpeg4.patch courtesy of Arch Linux
source="$pkgname-$pkgver.tar.gz::https://github.com/Motion-Project/$pkgname/archive/release-$pkgver.tar.gz
motion.confd
motion.initd
motion-dist.conf.in.patch
+ ffmpeg4.patch
"
builddir="$srcdir"/$pkgname-release-$pkgver
@@ -55,4 +57,5 @@ package() {
sha512sums="3b08d464f9243ccfc4b53b16cfc2001d1e0d206bf0295d55d8914914bc14ad0248ce5ac622cb7eb89ed32e1913a9a10add1b56497c4094ba876f7f85d6ad4143 motion-4.1.1.tar.gz
8a67b5b0360924e58ba3136a737ce73bb43201a49b2b6e2c632426561b830f6ab55cbbeaa89be7f1683aa8fd322b4f31b9f560e67a93eaceb964c9f56ceef363 motion.confd
be30f19595dba27f2d0ca8133c93e134161781935a152bd1701e581410039e37742acd11987c38e6e64f495b1fd2b0a74a8c61ae0e6e211a475fca7994172501 motion.initd
-c27d7ded3ed7a56101791bca86eb083450f5b8a1f431b3f7ee8538f682ac5f5d4b50104d9d61f40be964f1f1975a114313ba3d30d7357035dc25ebe925db6a89 motion-dist.conf.in.patch"
+c27d7ded3ed7a56101791bca86eb083450f5b8a1f431b3f7ee8538f682ac5f5d4b50104d9d61f40be964f1f1975a114313ba3d30d7357035dc25ebe925db6a89 motion-dist.conf.in.patch
+808a43fe51dd2d9436320fa3ba3ac3b3f87c829b276f175b52c77313acaa647dda43cd2acc0f9c6a3106ca0dec568ee12c6db7ad89cc49f501e34cd223bfb65e ffmpeg4.patch"
diff --git a/testing/motion/ffmpeg4.patch b/testing/motion/ffmpeg4.patch
new file mode 100644
index 0000000000..3ac4c7967b
--- /dev/null
+++ b/testing/motion/ffmpeg4.patch
@@ -0,0 +1,43 @@
+diff --git a/ffmpeg.c b/ffmpeg.c
+index 1e6cdf6..4299ba3 100644
+--- a/ffmpeg.c
++++ b/ffmpeg.c
+@@ -67,6 +67,19 @@
+
+ #endif
+
++/*********************************************/
++#if (LIBAVCODEC_VERSION_MAJOR >= 57)
++
++#define MY_CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
++#define MY_CODEC_FLAG_QSCALE AV_CODEC_FLAG_QSCALE
++
++#else
++
++#define MY_CODEC_FLAG_GLOBAL_HEADER CODEC_FLAG_GLOBAL_HEADER
++#define MY_CODEC_FLAG_QSCALE CODEC_FLAG_QSCALE
++
++#endif
++
+ /*********************************************/
+ AVFrame *my_frame_alloc(void){
+ AVFrame *pic;
+@@ -548,7 +561,7 @@ static int ffmpeg_set_quality(struct ffmpeg *ffmpeg){
+ /* The selection of 8000 is a subjective number based upon viewing output files */
+ if (ffmpeg->vbr > 0){
+ ffmpeg->vbr =(int)(((100-ffmpeg->vbr)*(100-ffmpeg->vbr)*(100-ffmpeg->vbr) * 8000) / 1000000) + 1;
+- ffmpeg->ctx_codec->flags |= CODEC_FLAG_QSCALE;
++ ffmpeg->ctx_codec->flags |= MY_CODEC_FLAG_QSCALE;
+ ffmpeg->ctx_codec->global_quality=ffmpeg->vbr;
+ }
+ }
+@@ -673,7 +686,7 @@ static int ffmpeg_set_codec(struct ffmpeg *ffmpeg){
+ ffmpeg->ctx_codec->strict_std_compliance = -2;
+ ffmpeg->ctx_codec->level = 3;
+ }
+- ffmpeg->ctx_codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
++ ffmpeg->ctx_codec->flags |= MY_CODEC_FLAG_GLOBAL_HEADER;
+
+ retcd = ffmpeg_set_quality(ffmpeg);
+ if (retcd < 0){
+