Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package spek for openSUSE:Factory checked in at 2022-12-13 18:57:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/spek (Old) and /work/SRC/openSUSE:Factory/.spek.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "spek" Tue Dec 13 18:57:07 2022 rev:3 rq:1042671 version:0.8.4 Changes: -------- --- /work/SRC/openSUSE:Factory/spek/spek.changes 2022-09-08 14:23:22.586630508 +0200 +++ /work/SRC/openSUSE:Factory/.spek.new.1835/spek.changes 2022-12-13 18:57:35.927885794 +0100 @@ -1,0 +2,7 @@ +Tue Dec 13 09:13:23 UTC 2022 - Bjørn Lie <[email protected]> + +- Add 232.patch: Replace deprecated FFmpeg APIs to support FFmpeg + 5.x. No longer limit ffmpeg dependencies to version 4.x.x. + https://github.com/alexkay/spek/pull/232 + +------------------------------------------------------------------- New: ---- 232.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ spek.spec ++++++ --- /var/tmp/diff_new_pack.fnaaj4/_old 2022-12-13 18:57:36.499888846 +0100 +++ /var/tmp/diff_new_pack.fnaaj4/_new 2022-12-13 18:57:36.503888868 +0100 @@ -24,6 +24,9 @@ Group: Productivity/Multimedia/Sound/Utilities URL: http://spek.cc/ Source: https://github.com/alexkay/spek/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM 232.patch -- Replace deprecated FFmpeg APIs to support FFmpeg 5.x +Patch0: https://patch-diff.githubusercontent.com/raw/alexkay/spek/pull/232.patch + BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc-c++ @@ -33,9 +36,9 @@ BuildRequires: pkgconfig BuildRequires: update-desktop-files BuildRequires: wxGTK-devel -BuildRequires: pkgconfig(libavcodec) <= 58.134.100 -BuildRequires: pkgconfig(libavformat) <= 58.76.100 -BuildRequires: pkgconfig(libavutil) <= 56.70.100 +BuildRequires: pkgconfig(libavcodec) +BuildRequires: pkgconfig(libavformat) +BuildRequires: pkgconfig(libavutil) %description Spek helps to analyse your audio files by showing their spectrogram. ++++++ 232.patch ++++++ >From 23f481e41a612b71f94f79546303545111c303ae Mon Sep 17 00:00:00 2001 From: MikeWang000000 <[email protected]> Date: Tue, 12 Jul 2022 00:49:00 +0800 Subject: [PATCH] Replace deprecated FFmpeg APIs to support FFmpeg 5.x --- src/spek-audio.cc | 58 +++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/spek-audio.cc b/src/spek-audio.cc index b7cfa47..3606d9c 100644 --- a/src/spek-audio.cc +++ b/src/spek-audio.cc @@ -50,7 +50,7 @@ class AudioFileImpl : public AudioFile int channel; - AVPacket packet; + AVPacket *packet; int offset; AVFrame *frame; int buffer_len; @@ -103,7 +103,7 @@ std::unique_ptr<AudioFile> Audio::open(const std::string& file_name, int stream) AVStream *avstream = nullptr; AVCodecParameters *codecpar = nullptr; - AVCodec *codec = nullptr; + const AVCodec *codec = nullptr; if (!error) { avstream = format_context->streams[audio_stream]; codecpar = avstream->codecpar; @@ -201,9 +201,9 @@ AudioFileImpl::AudioFileImpl( sample_rate(sample_rate), bits_per_sample(bits_per_sample), streams(streams), channels(channels), duration(duration) { - av_init_packet(&this->packet); - this->packet.data = nullptr; - this->packet.size = 0; + this->packet = av_packet_alloc(); + this->packet->data = nullptr; + this->packet->size = 0; this->offset = 0; this->frame = av_frame_alloc(); this->buffer_len = 0; @@ -221,11 +221,11 @@ AudioFileImpl::~AudioFileImpl() if (this->frame) { av_frame_free(&this->frame); } - if (this->packet.data) { - this->packet.data -= this->offset; - this->packet.size += this->offset; + if (this->packet->data) { + this->packet->data -= this->offset; + this->packet->size += this->offset; this->offset = 0; - av_packet_unref(&this->packet); + av_packet_unref(this->packet); } if (this->codec_context) { avcodec_free_context(&codec_context); @@ -258,23 +258,23 @@ int AudioFileImpl::read() } for (;;) { - while (this->packet.size > 0) { + while (this->packet->size > 0) { av_frame_unref(this->frame); - int got_frame = 0; - int len = avcodec_decode_audio4( - this->codec_context, this->frame, &got_frame, &this->packet - ); - if (len < 0) { - // Error, skip the frame. + int ret; + ret = avcodec_send_packet(this->codec_context, this->packet); + if (ret < 0) { + // Error sending a packet for decoding, skip the frame. break; } - this->packet.data += len; - this->packet.size -= len; - this->offset += len; - if (!got_frame) { - // No data yet, get more frames. - continue; + ret = avcodec_receive_frame(this->codec_context, this->frame); + if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) { + // Error during decoding, skip the frame. + break; } + int len = this->packet->size; + this->packet->data += len; + this->packet->size -= len; + this->offset += len; // We have data, return it and come back for more later. int samples = this->frame->nb_samples; if (samples > this->buffer_len) { @@ -324,19 +324,19 @@ int AudioFileImpl::read() } return samples; } - if (this->packet.data) { - this->packet.data -= this->offset; - this->packet.size += this->offset; + if (this->packet->data) { + this->packet->data -= this->offset; + this->packet->size += this->offset; this->offset = 0; - av_packet_unref(&this->packet); + av_packet_unref(this->packet); } int res = 0; - while ((res = av_read_frame(this->format_context, &this->packet)) >= 0) { - if (this->packet.stream_index == this->audio_stream) { + while ((res = av_read_frame(this->format_context, this->packet)) >= 0) { + if (this->packet->stream_index == this->audio_stream) { break; } - av_packet_unref(&this->packet); + av_packet_unref(this->packet); } if (res < 0) { // End of file or error.
