[SCM] ffmpeg2theora/master: add libavresample.patch to allow compilation against libavresample

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Mar 23 00:20:43 UTC 2014


The following commit has been merged in the master branch:
commit 9f190757fba4517dea87166219669b135e433a16
Author: Reinhard Tartler <siretart at tauware.de>
Date:   Sat Mar 22 19:37:41 2014 -0400

    add libavresample.patch to allow compilation against libavresample

diff --git a/debian/patches/libavresample.patch b/debian/patches/libavresample.patch
new file mode 100644
index 0000000..9fd7118
--- /dev/null
+++ b/debian/patches/libavresample.patch
@@ -0,0 +1,172 @@
+Description: Compile against libavresample
+Author: Reinhard Tartler <siretart at tauware.de>
+Bug-Debian: http://bugs.debian.org/739237
+Origin: Debian
+
+--- ffmpeg2theora-0.29~git+20140316.orig/src/ffmpeg2theora.c
++++ ffmpeg2theora-0.29~git+20140316/src/ffmpeg2theora.c
+@@ -355,14 +355,14 @@ static const char *find_category_for_sub
+   AVCodecContext *enc = this->context->streams[idx]->codec;
+   if (enc->codec_type != AVMEDIA_TYPE_SUBTITLE) return 0;
+   switch (enc->codec_id) {
+-    case CODEC_ID_TEXT:
+-    case CODEC_ID_SSA:
+-    case CODEC_ID_MOV_TEXT:
++    case AV_CODEC_ID_TEXT:
++    case AV_CODEC_ID_SSA:
++    case AV_CODEC_ID_MOV_TEXT:
+       if (included_subtitles & INCSUB_TEXT)
+         return "SUB";
+       else
+         return NULL;
+-    case CODEC_ID_DVD_SUBTITLE:
++    case AV_CODEC_ID_DVD_SUBTITLE:
+       if (included_subtitles & INCSUB_SPU)
+         return "K-SPU";
+       else
+@@ -603,8 +603,8 @@ void ff2theora_output(ff2theora this) {
+             vstream_fps.num = venc->time_base.den;
+             vstream_fps.den = venc->time_base.num * venc->ticks_per_frame;
+         }
+-        if (av_q2d(vstream->r_frame_rate) < av_q2d(vstream_fps)) {
+-            vstream_fps = vstream->r_frame_rate;
++        if (av_q2d(vstream->avg_frame_rate) < av_q2d(vstream_fps)) {
++            vstream_fps = vstream->avg_frame_rate;
+         }
+         this->fps = fps = av_q2d(vstream_fps);
+ 
+@@ -981,11 +981,11 @@ void ff2theora_output(ff2theora this) {
+                     av_opt_set_int(swr_ctx, "in_channel_layout", av_get_default_channel_layout(aenc->channels), 0);
+                 }
+                 av_opt_set_int(swr_ctx, "in_sample_rate",       aenc->sample_rate, 0);
+-                av_opt_set_sample_fmt(swr_ctx, "in_sample_fmt", aenc->sample_fmt, 0);
++                av_opt_set_int(swr_ctx, "in_sample_fmt", aenc->sample_fmt, 0);
+ 
+                 av_opt_set_int(swr_ctx, "out_channel_layout", av_get_default_channel_layout(this->channels), 0);
+                 av_opt_set_int(swr_ctx, "out_sample_rate",       this->sample_rate, 0);
+-                av_opt_set_sample_fmt(swr_ctx, "out_sample_fmt", AV_SAMPLE_FMT_FLTP, 0);
++                av_opt_set_int(swr_ctx, "out_sample_fmt", AV_SAMPLE_FMT_FLTP, 0);
+ 
+                 /* initialize the resampling context */
+                 if (swr_init(swr_ctx) < 0) {
+@@ -996,8 +996,8 @@ void ff2theora_output(ff2theora this) {
+                 max_dst_nb_samples = dst_nb_samples =
+                     av_rescale_rnd(src_nb_samples, this->sample_rate, sample_rate, AV_ROUND_UP);
+ 
+-                if (av_samples_alloc_array_and_samples(&dst_audio_data, &dst_linesize, this->channels,
+-                                                         dst_nb_samples, AV_SAMPLE_FMT_FLTP, 0) < 0) {
++                if (av_samples_alloc(&dst_audio_data, &dst_linesize, this->channels,
++                                     dst_nb_samples, AV_SAMPLE_FMT_FLTP, 0) < 0) {
+                     fprintf(stderr, "Could not allocate destination samples\n");
+                     exit(1);
+                 }
+@@ -1693,15 +1693,15 @@ void ff2theora_output(ff2theora this) {
+                     }
+                   }
+                 }
+-                else if (enc->codec_id == CODEC_ID_TEXT) {
++                else if (enc->codec_id == AV_CODEC_ID_TEXT) {
+                   utf8 = pkt.data;
+                   utf8len = pkt.size;
+                 }
+-                else if (enc->codec_id == CODEC_ID_SSA) {
++                else if (enc->codec_id == AV_CODEC_ID_SSA) {
+                   // SSA has control stuff in there, extract raw text
+                   extra_info_from_ssa(&pkt,&utf8,&utf8len,&allocated_utf8,&duration);
+                 }
+-                else if (enc->codec_id == CODEC_ID_MOV_TEXT) {
++                else if (enc->codec_id == AV_CODEC_ID_MOV_TEXT) {
+                   utf8 = pkt.data;
+                   utf8len = pkt.size;
+                   if (utf8len >= 2) {
+--- ffmpeg2theora-0.29~git+20140316.orig/src/libswresample_compat.h
++++ ffmpeg2theora-0.29~git+20140316/src/libswresample_compat.h
+@@ -10,6 +10,7 @@
+ #else
+ 
+     #include <libavresample/avresample.h>
++    #include <libavutil/mathematics.h>
+ 
+     #define SwrContext AVAudioResampleContext
+     #define swr_init(ctx) avresample_open(ctx)
+--- ffmpeg2theora-0.29~git+20140316.orig/src/avinfo.c
++++ ffmpeg2theora-0.29~git+20140316/src/avinfo.c
+@@ -174,7 +174,7 @@ void json_codec_info(FILE *output, AVCod
+ 
+     if (p) {
+         codec_name = p->name;
+-    } else if (enc->codec_id == CODEC_ID_MPEG2TS) {
++    } else if (enc->codec_id == AV_CODEC_ID_MPEG2TS) {
+         /* fake mpeg2 transport stream codec (currently not
+            registered) */
+         codec_name = "mpeg2ts";
+@@ -235,37 +235,37 @@ void json_codec_info(FILE *output, AVCod
+ 
+         /* for PCM codecs, compute bitrate directly */
+         switch(enc->codec_id) {
+-        case CODEC_ID_PCM_F64BE:
+-        case CODEC_ID_PCM_F64LE:
++        case AV_CODEC_ID_PCM_F64BE:
++        case AV_CODEC_ID_PCM_F64LE:
+             bitrate = enc->sample_rate * enc->channels * 64;
+             break;
+-        case CODEC_ID_PCM_S32LE:
+-        case CODEC_ID_PCM_S32BE:
+-        case CODEC_ID_PCM_U32LE:
+-        case CODEC_ID_PCM_U32BE:
+-        case CODEC_ID_PCM_F32BE:
+-        case CODEC_ID_PCM_F32LE:
++        case AV_CODEC_ID_PCM_S32LE:
++        case AV_CODEC_ID_PCM_S32BE:
++        case AV_CODEC_ID_PCM_U32LE:
++        case AV_CODEC_ID_PCM_U32BE:
++        case AV_CODEC_ID_PCM_F32BE:
++        case AV_CODEC_ID_PCM_F32LE:
+             bitrate = enc->sample_rate * enc->channels * 32;
+             break;
+-        case CODEC_ID_PCM_S24LE:
+-        case CODEC_ID_PCM_S24BE:
+-        case CODEC_ID_PCM_U24LE:
+-        case CODEC_ID_PCM_U24BE:
+-        case CODEC_ID_PCM_S24DAUD:
++        case AV_CODEC_ID_PCM_S24LE:
++        case AV_CODEC_ID_PCM_S24BE:
++        case AV_CODEC_ID_PCM_U24LE:
++        case AV_CODEC_ID_PCM_U24BE:
++        case AV_CODEC_ID_PCM_S24DAUD:
+             bitrate = enc->sample_rate * enc->channels * 24;
+             break;
+-        case CODEC_ID_PCM_S16LE:
+-        case CODEC_ID_PCM_S16BE:
+-        case CODEC_ID_PCM_S16LE_PLANAR:
+-        case CODEC_ID_PCM_U16LE:
+-        case CODEC_ID_PCM_U16BE:
++        case AV_CODEC_ID_PCM_S16LE:
++        case AV_CODEC_ID_PCM_S16BE:
++        case AV_CODEC_ID_PCM_S16LE_PLANAR:
++        case AV_CODEC_ID_PCM_U16LE:
++        case AV_CODEC_ID_PCM_U16BE:
+             bitrate = enc->sample_rate * enc->channels * 16;
+             break;
+-        case CODEC_ID_PCM_S8:
+-        case CODEC_ID_PCM_U8:
+-        case CODEC_ID_PCM_ALAW:
+-        case CODEC_ID_PCM_MULAW:
+-        case CODEC_ID_PCM_ZORK:
++        case AV_CODEC_ID_PCM_S8:
++        case AV_CODEC_ID_PCM_U8:
++        case AV_CODEC_ID_PCM_ALAW:
++        case AV_CODEC_ID_PCM_MULAW:
++        case AV_CODEC_ID_PCM_ZORK:
+             bitrate = enc->sample_rate * enc->channels * 8;
+             break;
+         default:
+@@ -324,7 +324,7 @@ static void json_stream_format(FILE *out
+                 json_add_key_value(output, "framerate", buf1, JSON_STRING, 0, indent + 1);
+             } else {
+                 snprintf(buf1, sizeof(buf1), "%d:%d",
+-                         st->r_frame_rate.num, st->r_frame_rate.den);
++                         st->avg_frame_rate.num, st->avg_frame_rate.den);
+                 json_add_key_value(output, "framerate", buf1, JSON_STRING, 0, indent + 1);
+             }
+             if (st->sample_aspect_ratio.num && // default
diff --git a/debian/patches/series b/debian/patches/series
index 507f15e..9b447e0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 #001-build-with-libav-0.7.patch
 #002-Makefile.patch
 #003-libswresample.patch
+libavresample.patch

-- 
ffmpeg2theora packaging



More information about the pkg-multimedia-commits mailing list