From 0889698d09076e1d2b66b4551e999b988144bccf Mon Sep 17 00:00:00 2001 From: Automatic Build System Date: Sat, 6 Jan 2024 00:23:11 +0100 Subject: [PATCH] automatic version update by autodist [release 21.12.2-1mamba;Sun Feb 06 2022] --- k3b-21.12.2-ffmpeg-5.0.patch | 72 ++++++++++++++++++++++++++++++++++++ k3b.spec | 7 +++- 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 k3b-21.12.2-ffmpeg-5.0.patch diff --git a/k3b-21.12.2-ffmpeg-5.0.patch b/k3b-21.12.2-ffmpeg-5.0.patch new file mode 100644 index 0000000..c2be65a --- /dev/null +++ b/k3b-21.12.2-ffmpeg-5.0.patch @@ -0,0 +1,72 @@ +diff -up k3b-21.12.1/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp.omv~ k3b-21.12.1/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp +--- k3b-21.12.1/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp.omv~ 2022-01-17 19:44:11.314744839 +0100 ++++ k3b-21.12.1/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp 2022-01-17 19:55:07.045724184 +0100 +@@ -38,7 +38,20 @@ extern "C" { + #include + + ++#if LIBAVCODEC_VERSION_MAJOR < 59 + #define FFMPEG_CODEC(s) (s->codec) ++#else ++static QMap k3b_codec_contexts; ++static inline AVCodecContext *FFMPEG_CODEC(AVStream *s) { ++ if(!k3b_codec_contexts.contains(s)) { ++ const AVCodec *codec = avcodec_find_decoder(s->codecpar->codec_id); ++ AVCodecContext *ctx = avcodec_alloc_context3(codec); ++ avcodec_parameters_to_context(ctx, s->codecpar); ++ k3b_codec_contexts.insert(s, ctx); ++ } ++ return k3b_codec_contexts.value(s); ++} ++#endif + + #ifndef HAVE_FFMPEG_AVFORMAT_OPEN_INPUT + // this works because the parameters/options are not used +@@ -70,7 +83,7 @@ class K3bFFMpegFile::Private + { + public: + ::AVFormatContext* formatContext; +- ::AVCodec* codec; ++ const ::AVCodec* codec; + ::AVStream *audio_stream; + + K3b::Msf length; +@@ -320,11 +333,28 @@ int K3bFFMpegFile::fillOutputBuffer() + } + + int gotFrame = 0; ++#if LIBAVCODEC_VERSION_MAJOR < 59 + int len = ::avcodec_decode_audio4( + FFMPEG_CODEC(d->audio_stream), + d->frame, + &gotFrame, + &d->packet ); ++#else ++ int ret = ::avcodec_receive_frame( ++ FFMPEG_CODEC(d->audio_stream), ++ d->frame); ++ ++ gotFrame = (ret == 0); ++ ++ ret = avcodec_send_packet( ++ FFMPEG_CODEC(d->audio_stream), ++ &d->packet ); ++ if (ret < 0) { ++ qDebug() << "(K3bFFMpegFile) decoding failed for " << m_filename; ++ return -1; ++ } ++ int len = d->packet.size; ++#endif + + if( d->packetSize <= 0 || len < 0 ) + ::av_packet_unref( &d->packet ); +@@ -393,7 +423,9 @@ bool K3bFFMpegFile::seek( const K3b::Msf + + K3bFFMpegWrapper::K3bFFMpegWrapper() + { ++#if LIBAVCODEC_VERSION_MAJOR < 59 + ::av_register_all(); ++#endif + } + + diff --git a/k3b.spec b/k3b.spec index fbc1ca6..96216d6 100644 --- a/k3b.spec +++ b/k3b.spec @@ -1,7 +1,7 @@ %define dirver %(echo %version | sed "s,alpha.*,,;s,rc.*,,") %define pkgver %(echo %version | sed "s|[a-z]||") Name: k3b -Version: 21.12.1 +Version: 21.12.2 Release: 1mamba Summary: The CD/DVD/Blu-Ray Creator for KDE License: GPL @@ -15,6 +15,7 @@ Patch0: %{name}-1.0.4-configure_ffmpeg.patch Patch1: k3b-2.0.2-ffmpeg.patch Patch2: k3b-2.0.3-disable-lsof-check.patch Patch3: k3b-2.0.3a-CMakeLists.patch +Patch4: k3b-21.12.2-ffmpeg-5.0.patch ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel BuildRequires: libQt5WebKit-devel @@ -136,6 +137,7 @@ This package contains static libraries and header files needed for development. #%patch1 -p1 %patch2 -p1 #%patch3 -p1 +%patch4 -p1 -b .ffmpeg-5.0 #rm -f doc/*/CMakeLists.txt @@ -216,6 +218,9 @@ exit 0 %doc ChangeLog %changelog +* Sun Feb 06 2022 Automatic Build System 21.12.2-1mamba +- automatic version update by autodist + * Thu Jan 06 2022 Automatic Build System 21.12.1-1mamba - automatic version update by autodist