spek

Acoustic spectrum analyser https://github.com/alexkay/spek spek.cc
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

ffmpeg_2.9.patch (1302B)


      1 Description: Replace deprecated FFmpeg API
      2 Author: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
      3 Last-Update: <2015-11-02>
      4 
      5 --- spek-0.8.2.orig/src/spek-audio.cc
      6 +++ spek-0.8.2/src/spek-audio.cc
      7 @@ -199,7 +199,7 @@ AudioFileImpl::AudioFileImpl(
      8      this->packet.data = nullptr;
      9      this->packet.size = 0;
     10      this->offset = 0;
     11 -    this->frame = avcodec_alloc_frame();
     12 +    this->frame = av_frame_alloc();
     13      this->buffer_size = 0;
     14      this->buffer = nullptr;
     15      this->frames_per_interval = 0;
     16 @@ -215,7 +215,7 @@ AudioFileImpl::~AudioFileImpl()
     17      if (this->frame) {
     18          // TODO: Remove this check after Debian switches to libav 9.
     19  #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0)
     20 -        avcodec_free_frame(&this->frame);
     21 +        av_frame_free(&this->frame);
     22  #else
     23          av_freep(&this->frame);
     24  #endif
     25 @@ -255,7 +255,7 @@ int AudioFileImpl::read()
     26  
     27      for (;;) {
     28          while (this->packet.size > 0) {
     29 -            avcodec_get_frame_defaults(this->frame);
     30 +            av_frame_unref(this->frame);
     31              auto codec_context = this->format_context->streams[this->audio_stream]->codec;
     32              int got_frame = 0;
     33              int len = avcodec_decode_audio4(codec_context, this->frame, &got_frame, &this->packet);
     34