[packages/libquicktime] - fix build with ffmpeg2

baggins baggins at pld-linux.org
Thu Aug 29 09:58:44 CEST 2013


commit 4b58cc926b52845435b2b16b19ad3ac845f157d9
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Thu Aug 29 09:58:35 2013 +0200

    - fix build with ffmpeg2

 libquicktime-ffmpeg2.patch | 98 ++++++++++++++++++++++++++++++++++++++++++++++
 libquicktime.spec          |  2 +
 2 files changed, 100 insertions(+)
---
diff --git a/libquicktime.spec b/libquicktime.spec
index 1f6c6af..b1d2e54 100644
--- a/libquicktime.spec
+++ b/libquicktime.spec
@@ -21,6 +21,7 @@ Group:		Libraries
 Source0:	http://downloads.sourceforge.net/libquicktime/%{name}-%{version}.tar.gz
 # Source0-md5:	81cfcebad9b7ee7e7cfbefc861d6d61b
 Patch0:		%{name}-ffmpeg07.patch
+Patch1:		%{name}-ffmpeg2.patch
 URL:		http://libquicktime.sourceforge.net/
 BuildRequires:	OpenGL-GLU-devel
 BuildRequires:	OpenGL-GLX-devel
@@ -246,6 +247,7 @@ Wtyczka schroedinger dla libquicktime.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %{__rm} m4/libtool.m4 m4/lt*.m4 m4/vorbis.m4
 
diff --git a/libquicktime-ffmpeg2.patch b/libquicktime-ffmpeg2.patch
new file mode 100644
index 0000000..7add442
--- /dev/null
+++ b/libquicktime-ffmpeg2.patch
@@ -0,0 +1,98 @@
+Extracted from upstream CVS.
+https://bugs.gentoo.org/show_bug.cgi?id=476498
+
+Index: libquicktime-1.2.4/plugins/ffmpeg/audio.c
+===================================================================
+--- libquicktime-1.2.4.orig/plugins/ffmpeg/audio.c
++++ libquicktime-1.2.4/plugins/ffmpeg/audio.c
+@@ -45,6 +45,11 @@
+ #define ENCODE_AUDIO 1
+ #endif
+ 
++#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
++/* from libavcodec/avcodec.h dated Dec 23 2012 */
++#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
++#endif
++
+ /* The following code was ported from gmerlin_avdecoder (http://gmerlin.sourceforge.net) */
+ 
+ /* MPEG Audio header parsing code */
+Index: libquicktime-1.2.4/plugins/ffmpeg/params.c
+===================================================================
+--- libquicktime-1.2.4.orig/plugins/ffmpeg/params.c
++++ libquicktime-1.2.4/plugins/ffmpeg/params.c
+@@ -101,6 +101,17 @@ typedef struct
+     }                                           \
+   }
+ 
++#define PARAM_DICT_INT(name, dict_name)             \
++  {                                                 \
++  if(!strcasecmp(name, key))                        \
++    {                                               \
++    char buf[128];                                  \
++    snprintf(buf, sizeof(buf), "%d", *(int*)value); \
++    av_dict_set(options, dict_name, buf, 0);        \
++    found = 1;                                      \
++    }                                               \
++  }
++
+ #define PARAM_DICT_FLAG(name, dict_name)        \
+   {                                             \
+   if(!strcasecmp(name, key))                    \
+@@ -202,8 +213,15 @@ void lqt_ffmpeg_set_parameter(AVCodecCon
+   PARAM_INT("ff_max_b_frames",max_b_frames);
+   PARAM_FLOAT("ff_b_quant_factor",b_quant_factor);
+   PARAM_INT("ff_b_frame_strategy",b_frame_strategy);
++
++#if LIBAVCODEC_VERSION_MAJOR >= 55
++  PARAM_DICT_INT("ff_luma_elim_threshold","luma_elim_threshold");
++  PARAM_DICT_INT("ff_chroma_elim_threshold","chroma_elim_threshold");
++#else
+   PARAM_INT("ff_luma_elim_threshold",luma_elim_threshold);
+   PARAM_INT("ff_chroma_elim_threshold",chroma_elim_threshold);
++#endif
++
+   PARAM_INT("ff_strict_std_compliance",strict_std_compliance);
+   PARAM_QP2LAMBDA("ff_b_quant_offset",b_quant_offset);
+   PARAM_INT("ff_rc_min_rate",rc_min_rate);
+@@ -241,8 +259,15 @@ void lqt_ffmpeg_set_parameter(AVCodecCon
+   PARAM_QP2LAMBDA("ff_lmax", lmax);
+   PARAM_INT("ff_noise_reduction",noise_reduction);
+   PARAM_INT_SCALE("ff_rc_initial_buffer_occupancy",rc_initial_buffer_occupancy,1000);
++
++#if LIBAVCODEC_VERSION_MAJOR >= 55
++  PARAM_DICT_INT("ff_inter_threshold","inter_threshold");
++  PARAM_DICT_INT("ff_quantizer_noise_shaping","quantizer_noise_shaping");
++#else
+   PARAM_INT("ff_inter_threshold",inter_threshold);
+   PARAM_INT("ff_quantizer_noise_shaping",quantizer_noise_shaping);
++#endif
++
+   PARAM_INT("ff_thread_count",thread_count);
+   PARAM_INT("ff_me_threshold",me_threshold);
+   PARAM_INT("ff_mb_threshold",mb_threshold);
+@@ -272,8 +297,16 @@ void lqt_ffmpeg_set_parameter(AVCodecCon
+   PARAM_FLAG("ff_flag_bitexact",CODEC_FLAG_BITEXACT);
+   PARAM_FLAG("ff_flag_ac_pred",CODEC_FLAG_AC_PRED);
+   //  PARAM_FLAG("ff_flag_h263p_umv",CODEC_FLAG_H263P_UMV); // Unused
++
++#if LIBAVCODEC_VERSION_MAJOR >= 55
++  PARAM_DICT_FLAG("ff_flag_cbp_rd","cbp_rd");
++  PARAM_DICT_FLAG("ff_flag_qp_rd","qp_rd");
++  PARAM_DICT_FLAG("ff_flag2_strict_gop","strict_gop");
++#else
+   PARAM_FLAG("ff_flag_cbp_rd",CODEC_FLAG_CBP_RD);
+   PARAM_FLAG("ff_flag_qp_rd",CODEC_FLAG_QP_RD);
++  PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP);
++#endif
+ 
+ #if LIBAVCODEC_VERSION_MAJOR >= 54
+   PARAM_DICT_FLAG("ff_flag_h263p_aiv", "aiv");
+@@ -288,7 +321,6 @@ void lqt_ffmpeg_set_parameter(AVCodecCon
+   PARAM_FLAG("ff_flag_loop_filter",CODEC_FLAG_LOOP_FILTER);
+   PARAM_FLAG("ff_flag_closed_gop",CODEC_FLAG_CLOSED_GOP);
+   PARAM_FLAG2("ff_flag2_fast",CODEC_FLAG2_FAST);
+-  PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP);
+   PARAM_ENUM("ff_coder_type",coder_type,coder_type);
+   
+   }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libquicktime.git/commitdiff/4b58cc926b52845435b2b16b19ad3ac845f157d9



More information about the pld-cvs-commit mailing list