1 --- audacity-src-1.3.13-beta.orig/src/export/ExportFFmpeg.cpp
2 +++ audacity-src-1.3.13-beta/src/export/ExportFFmpeg.cpp
4 avcodec_get_context_defaults(mEncAudioCodecCtx);
6 mEncAudioCodecCtx->codec_id = ExportFFmpegOptions::fmts[mSubFormat].codecid;
7 - mEncAudioCodecCtx->codec_type = CODEC_TYPE_AUDIO;
8 + mEncAudioCodecCtx->codec_type = AVMEDIA_TYPE_AUDIO;
9 mEncAudioCodecCtx->codec_tag = av_codec_get_tag((const AVCodecTag **)mEncFormatCtx->oformat->codec_tag,mEncAudioCodecCtx->codec_id);
10 mSampleRate = (int)project->GetRate();
11 mEncAudioCodecCtx->global_quality = -99999; //quality mode is off by default;
13 mEncAudioCodecCtx->flags2 = 0;
14 if (gPrefs->Read(wxT("/FileFormats/FFmpegBitReservoir"),true)) mEncAudioCodecCtx->flags2 |= CODEC_FLAG2_BIT_RESERVOIR;
15 if (gPrefs->Read(wxT("/FileFormats/FFmpegVariableBlockLen"),true)) mEncAudioCodecCtx->flags2 |= 0x0004; //WMA only?
16 - mEncAudioCodecCtx->use_lpc = gPrefs->Read(wxT("/FileFormats/FFmpegUseLPC"),true);
17 mEncAudioCodecCtx->compression_level = gPrefs->Read(wxT("/FileFormats/FFmpegCompLevel"),-1);
18 mEncAudioCodecCtx->frame_size = gPrefs->Read(wxT("/FileFormats/FFmpegFrameSize"),(long)0);
19 mEncAudioCodecCtx->lpc_coeff_precision = gPrefs->Read(wxT("/FileFormats/FFmpegLPCCoefPrec"),(long)0);
21 pkt.stream_index = mEncAudioStream->index;
22 pkt.data = mEncAudioEncodedBuf;
23 pkt.size = nEncodedBytes;
24 - pkt.flags |= PKT_FLAG_KEY;
25 + pkt.flags |= AV_PKT_FLAG_KEY;
27 // Set presentation time of frame (currently in the codec's timebase) in the stream timebase.
28 if(mEncAudioCodecCtx->coded_frame && mEncAudioCodecCtx->coded_frame->pts != int64_t(AV_NOPTS_VALUE))
31 pkt.stream_index = mEncAudioStream->index;
32 pkt.data = mEncAudioEncodedBuf;
33 - pkt.flags |= PKT_FLAG_KEY;
34 + pkt.flags |= AV_PKT_FLAG_KEY;
36 // Write the encoded audio frame to the output file.
37 if ((ret = av_interleaved_write_frame(mEncFormatCtx, &pkt)) != 0)
38 --- audacity-src-1.3.13-beta.orig/src/export/ExportFFmpegDialogs.cpp
39 +++ audacity-src-1.3.13-beta/src/export/ExportFFmpegDialogs.cpp
41 while ((codec = av_codec_next(codec)))
43 // We're only interested in audio and only in encoders
44 - if (codec->type == CODEC_TYPE_AUDIO && codec->encode)
45 + if (codec->type == AVMEDIA_TYPE_AUDIO && codec->encode)
47 mCodecNames.Add(wxString::FromUTF8(codec->name));
48 mCodecLongNames.Add(wxString::Format(wxT("%s - %s"),mCodecNames.Last().c_str(),wxString::FromUTF8(codec->long_name).c_str()));
50 // Find the codec, that is claimed to be compatible
51 AVCodec *codec = avcodec_find_encoder(CompatibilityList[i].codec);
52 // If it exists, is audio and has encoder
53 - if (codec != NULL && (codec->type == CODEC_TYPE_AUDIO) && codec->encode)
54 + if (codec != NULL && (codec->type == AVMEDIA_TYPE_AUDIO) && codec->encode)
56 // If it was selected - remember it's new index
57 if ((id >= 0) && codec->id == id) index = mShownCodecNames.GetCount();
59 AVCodec *codec = NULL;
60 while ((codec = av_codec_next(codec)))
62 - if (codec->type == CODEC_TYPE_AUDIO && codec->encode)
63 + if (codec->type == AVMEDIA_TYPE_AUDIO && codec->encode)
65 if (mShownCodecNames.Index(wxString::FromUTF8(codec->name)) < 0)
70 AVCodec *codec = avcodec_find_encoder(format->audio_codec);
71 - if (codec != NULL && (codec->type == CODEC_TYPE_AUDIO) && codec->encode)
72 + if (codec != NULL && (codec->type == AVMEDIA_TYPE_AUDIO) && codec->encode)
74 if ((id >= 0) && codec->id == id) index = mShownCodecNames.GetCount();
75 mShownCodecNames.Add(wxString::FromUTF8(codec->name));
76 --- audacity-src-1.3.13-beta.orig/src/FFmpeg.cpp
77 +++ audacity-src-1.3.13-beta/src/FFmpeg.cpp
80 pd.buf = (unsigned char *) av_malloc(PROBE_BUF_MAX + AVPROBE_PADDING_SIZE);
82 - err = AVERROR_NOMEM;
83 + err = AVERROR(ENOMEM);
89 // Didn't find a suitable format, so bail
91 - err = AVERROR_NOFMT;
92 + err = AVERROR(EILSEQ);
97 FFMPEG_INITDYN(codec, avcodec_find_decoder);
98 FFMPEG_INITDYN(codec, avcodec_get_context_defaults);
99 FFMPEG_INITDYN(codec, avcodec_open);
100 - FFMPEG_INITDYN(codec, avcodec_decode_audio2);
101 FFMPEG_INITDYN(codec, avcodec_decode_audio3);
102 FFMPEG_INITDYN(codec, avcodec_encode_audio);
103 FFMPEG_INITDYN(codec, avcodec_close);
104 --- audacity-src-1.3.13-beta.orig/src/FFmpeg.h
105 +++ audacity-src-1.3.13-beta/src/FFmpeg.h
107 FFMPEG_FUNCTION_WITH_RETURN(
110 +#if LIBAVUTIL_VERSION_MAJOR < 51
111 (void *ptr, unsigned int *size, unsigned int min_size),
113 + (void *ptr, unsigned int *size, size_t min_size),
115 (ptr, size, min_size)
117 FFMPEG_FUNCTION_WITH_RETURN(
119 FFMPEG_FUNCTION_WITH_RETURN(
122 +#if LIBAVUTIL_VERSION_MAJOR < 51
129 FFMPEG_FUNCTION_NO_RETURN(
130 --- audacity-src-1.3.13-beta.orig/src/import/ImportFFmpeg.cpp
131 +++ audacity-src-1.3.13-beta/src/import/ImportFFmpeg.cpp
133 // Fill the stream contexts
134 for (unsigned int i = 0; i < mFormatContext->nb_streams; i++)
136 - if (mFormatContext->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO)
137 + if (mFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
140 streamContext *sc = new streamContext;
141 --- audacity-src-1.3.13-beta.orig/src/ondemand/ODDecodeFFmpegTask.cpp
142 +++ audacity-src-1.3.13-beta/src/ondemand/ODDecodeFFmpegTask.cpp
144 //test the audio stream(s)
145 for (unsigned int i = 0; i < ic->nb_streams; i++)
147 - if (ic->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO)
148 + if (ic->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
150 audioStreamExists = true;
152 @@ -573,10 +573,10 @@
156 - // avcodec_decode_audio2() expects the size of the output buffer as the 3rd parameter but
157 + // avcodec_decode_audio3() expects the size of the output buffer as the 3rd parameter but
158 // also returns the number of bytes it decoded in the same parameter.
159 sc->m_decodedAudioSamplesValidSiz = sc->m_decodedAudioSamplesSiz;
160 - nBytesDecoded = avcodec_decode_audio2(sc->m_codecCtx,
161 + nBytesDecoded = avcodec_decode_audio3(sc->m_codecCtx,
162 sc->m_decodedAudioSamples, // out
163 &sc->m_decodedAudioSamplesValidSiz, // in/out
164 pDecode, nDecodeSiz); // in