Control: tags -1 patch
Control: forwarded -1 https://github.com/Motion-Project/motion/pull/657

On Wed, 24 Jan 2018 22:26:50 +0000 jcowg...@debian.org wrote:
> Source: motion
> Version: 4.0-1
> Severity: important
> User: debian-multime...@lists.debian.org
> Usertags: ffmpeg-3.5-transition
> 
> Hi,
> 
> Your package FTBFS with the upcoming version 3.5 of FFmpeg.

I submitted an upstream PR to fix this. Patch attached.

James
From ff99988d57f4bcb0a7b381374f8106896bda2b15 Mon Sep 17 00:00:00 2001
From: James Cowgill <jcowg...@jcowgill.uk>
Date: Fri, 23 Feb 2018 23:04:33 +0000
Subject: [PATCH] Fix build errors with FFmpeg 4.0

---
 ffmpeg.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

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){
@@ -1085,7 +1098,7 @@ static int ffmpeg_passthru_codec(struct ffmpeg *ffmpeg){
             pthread_mutex_unlock(&ffmpeg->rtsp_data->mutex_transfer);
             return -1;
         }
-        ffmpeg->video_st->codec->flags     |= CODEC_FLAG_GLOBAL_HEADER;
+        ffmpeg->video_st->codec->flags     |= MY_CODEC_FLAG_GLOBAL_HEADER;
         ffmpeg->video_st->codec->codec_tag  = 0;
 #else
         /* This is disabled in the util_check_passthrough but we need it here for compiling */
-- 
2.16.1

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to