]> git.pld-linux.org Git - packages/audacity.git/blob - audacity-ffmpeg.patch
- updated to 2.0.2
[packages/audacity.git] / audacity-ffmpeg.patch
1 --- audacity-src-1.3.13-beta.orig/src/export/ExportFFmpeg.cpp
2 +++ audacity-src-1.3.13-beta/src/export/ExportFFmpeg.cpp
3 @@ -352,7 +352,7 @@
4     avcodec_get_context_defaults(mEncAudioCodecCtx);
5  
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;
12 @@ -403,7 +403,6 @@
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);
20 @@ -569,7 +569,7 @@
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;
26  
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))
29 @@ -656,7 +656,7 @@
30  
31        pkt.stream_index = mEncAudioStream->index;
32        pkt.data = mEncAudioEncodedBuf;
33 -      pkt.flags |= PKT_FLAG_KEY;
34 +      pkt.flags |= AV_PKT_FLAG_KEY;
35  
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
40 @@ -1288,7 +1288,7 @@
41     while ((codec = av_codec_next(codec)))
42     {
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)
46        {
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()));
49 @@ -1528,7 +1528,7 @@
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)
55           {
56              // If it was selected - remember it's new index
57              if ((id >= 0) && codec->id == id) index = mShownCodecNames.GetCount();
58 @@ -1543,7 +1543,7 @@
59        AVCodec *codec = NULL;
60        while ((codec = av_codec_next(codec)))
61        {
62 -         if (codec->type == CODEC_TYPE_AUDIO && codec->encode)
63 +         if (codec->type == AVMEDIA_TYPE_AUDIO && codec->encode)
64           {
65              if (mShownCodecNames.Index(wxString::FromUTF8(codec->name)) < 0)
66              {
67 @@ -1563,7 +1563,7 @@
68        if (format != NULL)
69        {
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)
73           {
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
78 @@ -316,7 +316,7 @@
79     pd.buf_size = 0;
80     pd.buf = (unsigned char *) av_malloc(PROBE_BUF_MAX + AVPROBE_PADDING_SIZE);
81     if (pd.buf == NULL) {
82 -      err = AVERROR_NOMEM;
83 +      err = AVERROR(ENOMEM);
84        goto fail;
85     }
86  
87 @@ -381,7 +381,7 @@
88  
89     // Didn't find a suitable format, so bail
90     if (!fmt) {
91 -      err = AVERROR_NOFMT;
92 +      err = AVERROR(EILSEQ);
93        goto fail;
94     }
95  
96 @@ -855,7 +855,6 @@
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
106 @@ -559,7 +559,11 @@
107     FFMPEG_FUNCTION_WITH_RETURN(
108        void*,
109        av_fast_realloc,
110 +#if LIBAVUTIL_VERSION_MAJOR < 51
111        (void *ptr, unsigned int *size, unsigned int min_size),
112 +#else
113 +      (void *ptr, unsigned int *size, size_t min_size),
114 +#endif
115        (ptr, size, min_size)
116     );
117     FFMPEG_FUNCTION_WITH_RETURN(
118 @@ -747,7 +751,11 @@
119     FFMPEG_FUNCTION_WITH_RETURN(
120        void*,
121        av_malloc,
122 +#if LIBAVUTIL_VERSION_MAJOR < 51
123        (unsigned int size),
124 +#else
125 +      (size_t size),
126 +#endif
127        (size)
128     );
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
132 @@ -416,7 +416,7 @@
133     // Fill the stream contexts
134     for (unsigned int i = 0; i < mFormatContext->nb_streams; i++)
135     {
136 -      if (mFormatContext->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO)
137 +      if (mFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
138        {
139           //Create a context
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
143 @@ -156,7 +156,7 @@
144     //test the audio stream(s)
145     for (unsigned int i = 0; i < ic->nb_streams; i++)
146     {
147 -      if (ic->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO)
148 +      if (ic->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
149        {  
150           audioStreamExists = true;                 
151           st = ic->streams[i];
152 @@ -573,10 +573,10 @@
153        }
154     }
155  
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
165
This page took 0.038017 seconds and 3 git commands to generate.