Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 373213
Collapse All | Expand All

(-)file_not_specified_in_diff (-23 / +22 lines)
Line  Link Here
0
-- audacity-src-1.3.13-beta.orig/src/export/ExportFFmpeg.cpp
0
++ audacity-src-1.3.13-beta/src/export/ExportFFmpeg.cpp
Lines 352-358 Link Here
352
   avcodec_get_context_defaults(mEncAudioCodecCtx);
352
   avcodec_get_context_defaults(mEncAudioCodecCtx);
353
353
354
   mEncAudioCodecCtx->codec_id = ExportFFmpegOptions::fmts[mSubFormat].codecid;
354
   mEncAudioCodecCtx->codec_id = ExportFFmpegOptions::fmts[mSubFormat].codecid;
355
   mEncAudioCodecCtx->codec_type = CODEC_TYPE_AUDIO;
355
   mEncAudioCodecCtx->codec_type = AVMEDIA_TYPE_AUDIO;
356
   mEncAudioCodecCtx->codec_tag = av_codec_get_tag((const AVCodecTag **)mEncFormatCtx->oformat->codec_tag,mEncAudioCodecCtx->codec_id);
356
   mEncAudioCodecCtx->codec_tag = av_codec_get_tag((const AVCodecTag **)mEncFormatCtx->oformat->codec_tag,mEncAudioCodecCtx->codec_id);
357
   mSampleRate = (int)project->GetRate();
357
   mSampleRate = (int)project->GetRate();
358
   mEncAudioCodecCtx->global_quality = -99999; //quality mode is off by default;
358
   mEncAudioCodecCtx->global_quality = -99999; //quality mode is off by default;
Lines 403-409 Link Here
403
      mEncAudioCodecCtx->flags2 = 0;
403
      mEncAudioCodecCtx->flags2 = 0;
404
      if (gPrefs->Read(wxT("/FileFormats/FFmpegBitReservoir"),true)) mEncAudioCodecCtx->flags2 |= CODEC_FLAG2_BIT_RESERVOIR;
404
      if (gPrefs->Read(wxT("/FileFormats/FFmpegBitReservoir"),true)) mEncAudioCodecCtx->flags2 |= CODEC_FLAG2_BIT_RESERVOIR;
405
      if (gPrefs->Read(wxT("/FileFormats/FFmpegVariableBlockLen"),true)) mEncAudioCodecCtx->flags2 |= 0x0004; //WMA only?
405
      if (gPrefs->Read(wxT("/FileFormats/FFmpegVariableBlockLen"),true)) mEncAudioCodecCtx->flags2 |= 0x0004; //WMA only?
406
      mEncAudioCodecCtx->use_lpc = gPrefs->Read(wxT("/FileFormats/FFmpegUseLPC"),true);
406
      //mEncAudioCodecCtx->use_lpc = gPrefs->Read(wxT("/FileFormats/FFmpegUseLPC"),true);
407
      mEncAudioCodecCtx->compression_level = gPrefs->Read(wxT("/FileFormats/FFmpegCompLevel"),-1);
407
      mEncAudioCodecCtx->compression_level = gPrefs->Read(wxT("/FileFormats/FFmpegCompLevel"),-1);
408
      mEncAudioCodecCtx->frame_size = gPrefs->Read(wxT("/FileFormats/FFmpegFrameSize"),(long)0);
408
      mEncAudioCodecCtx->frame_size = gPrefs->Read(wxT("/FileFormats/FFmpegFrameSize"),(long)0);
409
      mEncAudioCodecCtx->lpc_coeff_precision = gPrefs->Read(wxT("/FileFormats/FFmpegLPCCoefPrec"),(long)0);
409
      mEncAudioCodecCtx->lpc_coeff_precision = gPrefs->Read(wxT("/FileFormats/FFmpegLPCCoefPrec"),(long)0);
Lines 569-575 Link Here
569
      pkt.stream_index = mEncAudioStream->index;
569
      pkt.stream_index = mEncAudioStream->index;
570
      pkt.data = mEncAudioEncodedBuf;
570
      pkt.data = mEncAudioEncodedBuf;
571
      pkt.size = nEncodedBytes;
571
      pkt.size = nEncodedBytes;
572
      pkt.flags |= PKT_FLAG_KEY;
572
      pkt.flags |= AV_PKT_FLAG_KEY;
573
573
574
      // Set presentation time of frame (currently in the codec's timebase) in the stream timebase.
574
      // Set presentation time of frame (currently in the codec's timebase) in the stream timebase.
575
      if(mEncAudioCodecCtx->coded_frame && mEncAudioCodecCtx->coded_frame->pts != int64_t(AV_NOPTS_VALUE))
575
      if(mEncAudioCodecCtx->coded_frame && mEncAudioCodecCtx->coded_frame->pts != int64_t(AV_NOPTS_VALUE))
Lines 656-662 Link Here
656
656
657
      pkt.stream_index = mEncAudioStream->index;
657
      pkt.stream_index = mEncAudioStream->index;
658
      pkt.data = mEncAudioEncodedBuf;
658
      pkt.data = mEncAudioEncodedBuf;
659
      pkt.flags |= PKT_FLAG_KEY;
659
      pkt.flags |= AV_PKT_FLAG_KEY;
660
660
661
      // Write the encoded audio frame to the output file.
661
      // Write the encoded audio frame to the output file.
662
      if ((ret = av_interleaved_write_frame(mEncFormatCtx, &pkt)) != 0)
662
      if ((ret = av_interleaved_write_frame(mEncFormatCtx, &pkt)) != 0)
663
-- audacity-src-1.3.13-beta.orig/src/export/ExportFFmpegDialogs.cpp
663
++ audacity-src-1.3.13-beta/src/export/ExportFFmpegDialogs.cpp
Lines 1288-1294 Link Here
1288
   while ((codec = av_codec_next(codec)))
1288
   while ((codec = av_codec_next(codec)))
1289
   {
1289
   {
1290
      // We're only interested in audio and only in encoders
1290
      // We're only interested in audio and only in encoders
1291
      if (codec->type == CODEC_TYPE_AUDIO && codec->encode)
1291
      if (codec->type == AVMEDIA_TYPE_AUDIO && codec->encode)
1292
      {
1292
      {
1293
         mCodecNames.Add(wxString::FromUTF8(codec->name));
1293
         mCodecNames.Add(wxString::FromUTF8(codec->name));
1294
         mCodecLongNames.Add(wxString::Format(wxT("%s - %s"),mCodecNames.Last().c_str(),wxString::FromUTF8(codec->long_name).c_str()));
1294
         mCodecLongNames.Add(wxString::Format(wxT("%s - %s"),mCodecNames.Last().c_str(),wxString::FromUTF8(codec->long_name).c_str()));
Lines 1528-1534 Link Here
1528
         // Find the codec, that is claimed to be compatible
1528
         // Find the codec, that is claimed to be compatible
1529
         AVCodec *codec = avcodec_find_encoder(CompatibilityList[i].codec);
1529
         AVCodec *codec = avcodec_find_encoder(CompatibilityList[i].codec);
1530
         // If it exists, is audio and has encoder
1530
         // If it exists, is audio and has encoder
1531
         if (codec != NULL && (codec->type == CODEC_TYPE_AUDIO) && codec->encode)
1531
         if (codec != NULL && (codec->type == AVMEDIA_TYPE_AUDIO) && codec->encode)
1532
         {
1532
         {
1533
            // If it was selected - remember it's new index
1533
            // If it was selected - remember it's new index
1534
            if ((id >= 0) && codec->id == id) index = mShownCodecNames.GetCount();
1534
            if ((id >= 0) && codec->id == id) index = mShownCodecNames.GetCount();
Lines 1543-1549 Link Here
1543
      AVCodec *codec = NULL;
1543
      AVCodec *codec = NULL;
1544
      while ((codec = av_codec_next(codec)))
1544
      while ((codec = av_codec_next(codec)))
1545
      {
1545
      {
1546
         if (codec->type == CODEC_TYPE_AUDIO && codec->encode)
1546
         if (codec->type == AVMEDIA_TYPE_AUDIO && codec->encode)
1547
         {
1547
         {
1548
            if (mShownCodecNames.Index(wxString::FromUTF8(codec->name)) < 0)
1548
            if (mShownCodecNames.Index(wxString::FromUTF8(codec->name)) < 0)
1549
            {
1549
            {
Lines 1563-1569 Link Here
1563
      if (format != NULL)
1563
      if (format != NULL)
1564
      {
1564
      {
1565
         AVCodec *codec = avcodec_find_encoder(format->audio_codec);
1565
         AVCodec *codec = avcodec_find_encoder(format->audio_codec);
1566
         if (codec != NULL && (codec->type == CODEC_TYPE_AUDIO) && codec->encode)
1566
         if (codec != NULL && (codec->type == AVMEDIA_TYPE_AUDIO) && codec->encode)
1567
         {
1567
         {
1568
            if ((id >= 0) && codec->id == id) index = mShownCodecNames.GetCount();
1568
            if ((id >= 0) && codec->id == id) index = mShownCodecNames.GetCount();
1569
            mShownCodecNames.Add(wxString::FromUTF8(codec->name));
1569
            mShownCodecNames.Add(wxString::FromUTF8(codec->name));
1570
-- audacity-src-1.3.13-beta.orig/src/FFmpeg.cpp
1570
++ audacity-src-1.3.13-beta/src/FFmpeg.cpp
Lines 316-322 Link Here
316
   pd.buf_size = 0;
316
   pd.buf_size = 0;
317
   pd.buf = (unsigned char *) av_malloc(PROBE_BUF_MAX + AVPROBE_PADDING_SIZE);
317
   pd.buf = (unsigned char *) av_malloc(PROBE_BUF_MAX + AVPROBE_PADDING_SIZE);
318
   if (pd.buf == NULL) {
318
   if (pd.buf == NULL) {
319
      err = AVERROR_NOMEM;
319
      err = AVERROR(ENOMEM);
320
      goto fail;
320
      goto fail;
321
   }
321
   }
322
322
Lines 381-387 Link Here
381
381
382
   // Didn't find a suitable format, so bail
382
   // Didn't find a suitable format, so bail
383
   if (!fmt) {
383
   if (!fmt) {
384
      err = AVERROR_NOFMT;
384
      err = AVERROR(EILSEQ);
385
      goto fail;
385
      goto fail;
386
   }
386
   }
387
387
Lines 855-861 Link Here
855
   FFMPEG_INITDYN(codec, avcodec_find_decoder);
855
   FFMPEG_INITDYN(codec, avcodec_find_decoder);
856
   FFMPEG_INITDYN(codec, avcodec_get_context_defaults);
856
   FFMPEG_INITDYN(codec, avcodec_get_context_defaults);
857
   FFMPEG_INITDYN(codec, avcodec_open);
857
   FFMPEG_INITDYN(codec, avcodec_open);
858
   FFMPEG_INITDYN(codec, avcodec_decode_audio2);
859
   FFMPEG_INITDYN(codec, avcodec_decode_audio3);
858
   FFMPEG_INITDYN(codec, avcodec_decode_audio3);
860
   FFMPEG_INITDYN(codec, avcodec_encode_audio);
859
   FFMPEG_INITDYN(codec, avcodec_encode_audio);
861
   FFMPEG_INITDYN(codec, avcodec_close);
860
   FFMPEG_INITDYN(codec, avcodec_close);
862
-- audacity-src-1.3.13-beta.orig/src/FFmpeg.h
861
++ audacity-src-1.3.13-beta/src/FFmpeg.h
Lines 559-565 Link Here
559
   FFMPEG_FUNCTION_WITH_RETURN(
559
   FFMPEG_FUNCTION_WITH_RETURN(
560
      void*,
560
      void*,
561
      av_fast_realloc,
561
      av_fast_realloc,
562
      (void *ptr, unsigned int *size, unsigned int min_size),
562
      (void *ptr, unsigned int *size, size_t min_size),
563
      (ptr, size, min_size)
563
      (ptr, size, min_size)
564
   );
564
   );
565
   FFMPEG_FUNCTION_WITH_RETURN(
565
   FFMPEG_FUNCTION_WITH_RETURN(
Lines 747-753 Link Here
747
   FFMPEG_FUNCTION_WITH_RETURN(
747
   FFMPEG_FUNCTION_WITH_RETURN(
748
      void*,
748
      void*,
749
      av_malloc,
749
      av_malloc,
750
      (unsigned int size),
750
      (size_t size),
751
      (size)
751
      (size)
752
   );
752
   );
753
   FFMPEG_FUNCTION_NO_RETURN(
753
   FFMPEG_FUNCTION_NO_RETURN(
754
-- audacity-src-1.3.13-beta.orig/src/import/ImportFFmpeg.cpp
754
++ audacity-src-1.3.13-beta/src/import/ImportFFmpeg.cpp
Lines 416-422 Link Here
416
   // Fill the stream contexts
416
   // Fill the stream contexts
417
   for (unsigned int i = 0; i < mFormatContext->nb_streams; i++)
417
   for (unsigned int i = 0; i < mFormatContext->nb_streams; i++)
418
   {
418
   {
419
      if (mFormatContext->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO)
419
      if (mFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
420
      {
420
      {
421
         //Create a context
421
         //Create a context
422
         streamContext *sc = new streamContext;
422
         streamContext *sc = new streamContext;
423
-- audacity-src-1.3.13-beta.orig/src/ondemand/ODDecodeFFmpegTask.cpp
423
++ audacity-src-1.3.13-beta/src/ondemand/ODDecodeFFmpegTask.cpp
Lines 156-162 Link Here
156
   //test the audio stream(s)
156
   //test the audio stream(s)
157
   for (unsigned int i = 0; i < ic->nb_streams; i++)
157
   for (unsigned int i = 0; i < ic->nb_streams; i++)
158
   {
158
   {
159
      if (ic->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO)
159
      if (ic->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
160
      {  
160
      {  
161
         audioStreamExists = true;                 
161
         audioStreamExists = true;                 
162
         st = ic->streams[i];
162
         st = ic->streams[i];
Lines 573-582 Link Here
573
      }
573
      }
574
   }
574
   }
575
575
576
   // avcodec_decode_audio2() expects the size of the output buffer as the 3rd parameter but
576
   // avcodec_decode_audio3() expects the size of the output buffer as the 3rd parameter but
577
   // also returns the number of bytes it decoded in the same parameter.
577
   // also returns the number of bytes it decoded in the same parameter.
578
   sc->m_decodedAudioSamplesValidSiz = sc->m_decodedAudioSamplesSiz;
578
   sc->m_decodedAudioSamplesValidSiz = sc->m_decodedAudioSamplesSiz;
579
   nBytesDecoded = avcodec_decode_audio2(sc->m_codecCtx, 
579
   nBytesDecoded = avcodec_decode_audio3(sc->m_codecCtx, 
580
      sc->m_decodedAudioSamples,		      // out
580
      sc->m_decodedAudioSamples,		      // out
581
      &sc->m_decodedAudioSamplesValidSiz,	// in/out
581
      &sc->m_decodedAudioSamplesValidSiz,	// in/out
582
      pDecode, nDecodeSiz);				   // in
582
      pDecode, nDecodeSiz);				   // in

Return to bug 373213