Ticket #40464: libquicktime-ffmpeg.patch

File libquicktime-ffmpeg.patch, 4.6 KB (added by mojca (Mojca Miklavec), 10 years ago)

a minimum patch to avoid compile errors

  • Portfile

     
    2525                    port:libvorbis port:libogg port:lame port:xorg-libXv \
    2626                    port:xorg-libXaw port:x264
    2727
    28 patchfiles          patch-configure.diff
     28patchfiles          patch-configure.diff \
     29                    patch-plugins-ffmpeg-audio.c.diff \
     30                    patch-plugins-ffmpeg-params.c.diff
    2931
    3032configure.args      --without-gtk --without-alsa \
    3133                    --with-libjpeg --with-libpng --with-ffmpeg \
  • files/patch-plugins-ffmpeg-audio.c.diff

     
     1--- plugins/ffmpeg/audio.c.orig
     2+++ plugins/ffmpeg/audio.c
     3@@ -45,6 +45,11 @@
     4 #define ENCODE_AUDIO 1
     5 #endif
     6 
     7+#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
     8+/* from libavcodec/avcodec.h dated Dec 23 2012 */
     9+#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
     10+#endif
     11+
     12 /* The following code was ported from gmerlin_avdecoder (http://gmerlin.sourceforge.net) */
     13 
     14 /* MPEG Audio header parsing code */
  • files/patch-plugins-ffmpeg-params.c.diff

     
     1--- plugins/ffmpeg/params.c.orig
     2+++ plugins/ffmpeg/params.c
     3@@ -101,6 +101,17 @@
     4     }                                           \
     5   }
     6 
     7+#define PARAM_DICT_INT(name, dict_name)             \
     8+  {                                                 \
     9+  if(!strcasecmp(name, key))                        \
     10+    {                                               \
     11+    char buf[128];                                  \
     12+    snprintf(buf, sizeof(buf), "%d", *(int*)value); \
     13+    av_dict_set(options, dict_name, buf, 0);        \
     14+    found = 1;                                      \
     15+    }                                               \
     16+  }
     17+
     18 #define PARAM_DICT_FLAG(name, dict_name)        \
     19   {                                             \
     20   if(!strcasecmp(name, key))                    \
     21@@ -202,8 +213,15 @@
     22   PARAM_INT("ff_max_b_frames",max_b_frames);
     23   PARAM_FLOAT("ff_b_quant_factor",b_quant_factor);
     24   PARAM_INT("ff_b_frame_strategy",b_frame_strategy);
     25+
     26+#if LIBAVCODEC_VERSION_MAJOR >= 55
     27+  PARAM_DICT_INT("ff_luma_elim_threshold","luma_elim_threshold");
     28+  PARAM_DICT_INT("ff_chroma_elim_threshold","chroma_elim_threshold");
     29+#else
     30   PARAM_INT("ff_luma_elim_threshold",luma_elim_threshold);
     31   PARAM_INT("ff_chroma_elim_threshold",chroma_elim_threshold);
     32+#endif
     33+
     34   PARAM_INT("ff_strict_std_compliance",strict_std_compliance);
     35   PARAM_QP2LAMBDA("ff_b_quant_offset",b_quant_offset);
     36   PARAM_INT("ff_rc_min_rate",rc_min_rate);
     37@@ -241,8 +259,15 @@
     38   PARAM_QP2LAMBDA("ff_lmax", lmax);
     39   PARAM_INT("ff_noise_reduction",noise_reduction);
     40   PARAM_INT_SCALE("ff_rc_initial_buffer_occupancy",rc_initial_buffer_occupancy,1000);
     41+
     42+#if LIBAVCODEC_VERSION_MAJOR >= 55
     43+  PARAM_DICT_INT("ff_inter_threshold","inter_threshold");
     44+  PARAM_DICT_INT("ff_quantizer_noise_shaping","quantizer_noise_shaping");
     45+#else
     46   PARAM_INT("ff_inter_threshold",inter_threshold);
     47   PARAM_INT("ff_quantizer_noise_shaping",quantizer_noise_shaping);
     48+#endif
     49+
     50   PARAM_INT("ff_thread_count",thread_count);
     51   PARAM_INT("ff_me_threshold",me_threshold);
     52   PARAM_INT("ff_mb_threshold",mb_threshold);
     53@@ -272,8 +297,16 @@
     54   PARAM_FLAG("ff_flag_bitexact",CODEC_FLAG_BITEXACT);
     55   PARAM_FLAG("ff_flag_ac_pred",CODEC_FLAG_AC_PRED);
     56   //  PARAM_FLAG("ff_flag_h263p_umv",CODEC_FLAG_H263P_UMV); // Unused
     57+
     58+#if LIBAVCODEC_VERSION_MAJOR >= 55
     59+  PARAM_DICT_FLAG("ff_flag_cbp_rd","cbp_rd");
     60+  PARAM_DICT_FLAG("ff_flag_qp_rd","qp_rd");
     61+  PARAM_DICT_FLAG("ff_flag2_strict_gop","strict_gop");
     62+#else
     63   PARAM_FLAG("ff_flag_cbp_rd",CODEC_FLAG_CBP_RD);
     64   PARAM_FLAG("ff_flag_qp_rd",CODEC_FLAG_QP_RD);
     65+  PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP);
     66+#endif
     67 
     68 #if LIBAVCODEC_VERSION_MAJOR >= 54
     69   PARAM_DICT_FLAG("ff_flag_h263p_aiv", "aiv");
     70@@ -288,7 +321,6 @@
     71   PARAM_FLAG("ff_flag_loop_filter",CODEC_FLAG_LOOP_FILTER);
     72   PARAM_FLAG("ff_flag_closed_gop",CODEC_FLAG_CLOSED_GOP);
     73   PARAM_FLAG2("ff_flag2_fast",CODEC_FLAG2_FAST);
     74-  PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP);
     75   PARAM_ENUM("ff_coder_type",coder_type,coder_type);
     76   
     77   }