[SCM] audacity/master: Unbreak compilation against 0.7

bdrung at users.alioth.debian.org bdrung at users.alioth.debian.org
Sat May 28 16:20:27 UTC 2011


The following commit has been merged in the master branch:
commit e0a7281783402a74da1ea753e5d07f49aa77e791
Author: Benjamin Drung <bdrung at debian.org>
Date:   Sat May 28 13:12:48 2011 +0200

    Unbreak compilation against 0.7
    
    Closes: #628201
    Thanks: Reinhard Tartler <siretart at tauware.de>

diff --git a/debian/patches/libav-0.7.patch b/debian/patches/libav-0.7.patch
new file mode 100644
index 0000000..99ead7c
--- /dev/null
+++ b/debian/patches/libav-0.7.patch
@@ -0,0 +1,116 @@
+From: Reinhard Tartler <siretart at tauware.de>
+Subject: Unbreak compilation against 0.7
+Forwarded: no
+Bug-Debian: http://bugs.debian.org/628201
+Date: Sat, 28 May 2011 11:40:37 +0200
+Note: The change in src/export/ExportFFmpeg.cpp is incomplete, as it
+ disables functionality!
+
+--- a/src/FFmpeg.cpp
++++ b/src/FFmpeg.cpp
+@@ -316,7 +316,7 @@
+    pd.buf_size = 0;
+    pd.buf = (unsigned char *) av_malloc(PROBE_BUF_MAX + AVPROBE_PADDING_SIZE);
+    if (pd.buf == NULL) {
+-      err = AVERROR_NOMEM;
++      err = AVERROR(ENOMEM);
+       goto fail;
+    }
+ 
+@@ -381,7 +381,7 @@
+ 
+    // Didn't find a suitable format, so bail
+    if (!fmt) {
+-      err = AVERROR_NOFMT;
++      err = AVERROR(EILSEQ);
+       goto fail;
+    }
+ 
+--- a/src/export/ExportFFmpeg.cpp
++++ b/src/export/ExportFFmpeg.cpp
+@@ -352,7 +352,7 @@
+    avcodec_get_context_defaults(mEncAudioCodecCtx);
+ 
+    mEncAudioCodecCtx->codec_id = ExportFFmpegOptions::fmts[mSubFormat].codecid;
+-   mEncAudioCodecCtx->codec_type = CODEC_TYPE_AUDIO;
++   mEncAudioCodecCtx->codec_type = AVMEDIA_TYPE_AUDIO;
+    mEncAudioCodecCtx->codec_tag = av_codec_get_tag((const AVCodecTag **)mEncFormatCtx->oformat->codec_tag,mEncAudioCodecCtx->codec_id);
+    mSampleRate = (int)project->GetRate();
+    mEncAudioCodecCtx->global_quality = -99999; //quality mode is off by default;
+@@ -403,7 +403,8 @@
+       mEncAudioCodecCtx->flags2 = 0;
+       if (gPrefs->Read(wxT("/FileFormats/FFmpegBitReservoir"),true)) mEncAudioCodecCtx->flags2 |= CODEC_FLAG2_BIT_RESERVOIR;
+       if (gPrefs->Read(wxT("/FileFormats/FFmpegVariableBlockLen"),true)) mEncAudioCodecCtx->flags2 |= 0x0004; //WMA only?
+-      mEncAudioCodecCtx->use_lpc = gPrefs->Read(wxT("/FileFormats/FFmpegUseLPC"),true);
++      // Fixme: This needs UI changes so that the user can select the number of passes and type!
++      // mEncAudioCodecCtx->use_lpc = gPrefs->Read(wxT("/FileFormats/FFmpegUseLPC"),true);
+       mEncAudioCodecCtx->compression_level = gPrefs->Read(wxT("/FileFormats/FFmpegCompLevel"),-1);
+       mEncAudioCodecCtx->frame_size = gPrefs->Read(wxT("/FileFormats/FFmpegFrameSize"),(long)0);
+       mEncAudioCodecCtx->lpc_coeff_precision = gPrefs->Read(wxT("/FileFormats/FFmpegLPCCoefPrec"),(long)0);
+@@ -569,7 +570,7 @@
+       pkt.stream_index = mEncAudioStream->index;
+       pkt.data = mEncAudioEncodedBuf;
+       pkt.size = nEncodedBytes;
+-      pkt.flags |= PKT_FLAG_KEY;
++      pkt.flags |= AV_PKT_FLAG_KEY;
+ 
+       // Set presentation time of frame (currently in the codec's timebase) in the stream timebase.
+       if(mEncAudioCodecCtx->coded_frame && mEncAudioCodecCtx->coded_frame->pts != int64_t(AV_NOPTS_VALUE))
+@@ -656,7 +657,7 @@
+ 
+       pkt.stream_index = mEncAudioStream->index;
+       pkt.data = mEncAudioEncodedBuf;
+-      pkt.flags |= PKT_FLAG_KEY;
++      pkt.flags |= AV_PKT_FLAG_KEY;
+ 
+       // Write the encoded audio frame to the output file.
+       if ((ret = av_interleaved_write_frame(mEncFormatCtx, &pkt)) != 0)
+--- a/src/export/ExportFFmpegDialogs.cpp
++++ b/src/export/ExportFFmpegDialogs.cpp
+@@ -1288,7 +1288,7 @@
+    while ((codec = av_codec_next(codec)))
+    {
+       // We're only interested in audio and only in encoders
+-      if (codec->type == CODEC_TYPE_AUDIO && codec->encode)
++      if (codec->type == AVMEDIA_TYPE_AUDIO && codec->encode)
+       {
+          mCodecNames.Add(wxString::FromUTF8(codec->name));
+          mCodecLongNames.Add(wxString::Format(wxT("%s - %s"),mCodecNames.Last().c_str(),wxString::FromUTF8(codec->long_name).c_str()));
+@@ -1528,7 +1528,7 @@
+          // Find the codec, that is claimed to be compatible
+          AVCodec *codec = avcodec_find_encoder(CompatibilityList[i].codec);
+          // If it exists, is audio and has encoder
+-         if (codec != NULL && (codec->type == CODEC_TYPE_AUDIO) && codec->encode)
++         if (codec != NULL && (codec->type == AVMEDIA_TYPE_AUDIO) && codec->encode)
+          {
+             // If it was selected - remember it's new index
+             if ((id >= 0) && codec->id == id) index = mShownCodecNames.GetCount();
+@@ -1543,7 +1543,7 @@
+       AVCodec *codec = NULL;
+       while ((codec = av_codec_next(codec)))
+       {
+-         if (codec->type == CODEC_TYPE_AUDIO && codec->encode)
++         if (codec->type == AVMEDIA_TYPE_AUDIO && codec->encode)
+          {
+             if (mShownCodecNames.Index(wxString::FromUTF8(codec->name)) < 0)
+             {
+@@ -1563,7 +1563,7 @@
+       if (format != NULL)
+       {
+          AVCodec *codec = avcodec_find_encoder(format->audio_codec);
+-         if (codec != NULL && (codec->type == CODEC_TYPE_AUDIO) && codec->encode)
++         if (codec != NULL && (codec->type == AVMEDIA_TYPE_AUDIO) && codec->encode)
+          {
+             if ((id >= 0) && codec->id == id) index = mShownCodecNames.GetCount();
+             mShownCodecNames.Add(wxString::FromUTF8(codec->name));
+--- a/src/import/ImportFFmpeg.cpp
++++ b/src/import/ImportFFmpeg.cpp
+@@ -416,7 +416,7 @@
+    // Fill the stream contexts
+    for (unsigned int i = 0; i < mFormatContext->nb_streams; i++)
+    {
+-      if (mFormatContext->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO)
++      if (mFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
+       {
+          //Create a context
+          streamContext *sc = new streamContext;
diff --git a/debian/patches/series b/debian/patches/series
index d0ce9b8..65e5970 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ upstream-bug-350.patch
 upstream-bug-367.patch
 disable-dynamic-ffmpeg.patch
 disable-dynamic-lame.patch
+libav-0.7.patch

-- 
Audacity debian packaging



More information about the pkg-multimedia-commits mailing list