[packages/simplescreenrecorder] - add upstream fix for ffmpeg 6, rel 2

baggins baggins at pld-linux.org
Sat Oct 21 22:58:09 CEST 2023


commit 6cc1b2f27d340fb91b8c9137209b795498ead54b
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sat Oct 21 22:57:45 2023 +0200

    - add upstream fix for ffmpeg 6, rel 2

 ffmpeg6.patch             | 63 +++++++++++++++++++++++++++++++++++++++++++++++
 simplescreenrecorder.spec |  4 ++-
 2 files changed, 66 insertions(+), 1 deletion(-)
---
diff --git a/simplescreenrecorder.spec b/simplescreenrecorder.spec
index e22b2cb..c3bfbc0 100644
--- a/simplescreenrecorder.spec
+++ b/simplescreenrecorder.spec
@@ -7,11 +7,12 @@ Summary:	Screen recorder for Linux
 Summary(pl.UTF-8):	Nagrywarka ekranu dla Linuksa
 Name:		simplescreenrecorder
 Version:	0.4.4
-Release:	1
+Release:	2
 License:	GPL v3
 Group:		Applications
 Source0:	https://github.com/MaartenBaert/ssr/archive/%{version}/ssr-%{version}.tar.gz
 # Source0-md5:	6360ff633bcb88b0c221d56fd52b7dac
+Patch0:		ffmpeg6.patch
 URL:		http://www.maartenbaert.be/simplescreenrecorder/
 BuildRequires:	Mesa-libGL-devel
 BuildRequires:	Mesa-libGLU-devel
@@ -57,6 +58,7 @@ OpenGL applications, for use with the SimpleScreenRecorder.
 
 %prep
 %setup -q -n ssr-%{version}
+%patch0 -p1
 
 %build
 %cmake \
diff --git a/ffmpeg6.patch b/ffmpeg6.patch
new file mode 100644
index 0000000..654232a
--- /dev/null
+++ b/ffmpeg6.patch
@@ -0,0 +1,63 @@
+From 768957a8de1534f0aa91bfc5d7af3c32f222beb8 Mon Sep 17 00:00:00 2001
+From: Maarten Baert <maarten-baert at hotmail.com>
+Date: Sun, 20 Mar 2022 22:52:43 +0100
+Subject: [PATCH] Fix for compatibility with newer FFmpeg versions
+
+---
+ src/AV/Output/AudioEncoder.cpp | 3 ++-
+ src/AV/Output/Muxer.cpp        | 6 ++++--
+ src/AV/Output/VideoEncoder.cpp | 3 ++-
+ 3 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/src/AV/Output/AudioEncoder.cpp b/src/AV/Output/AudioEncoder.cpp
+index 34d015cf..3efde703 100644
+--- a/src/AV/Output/AudioEncoder.cpp
++++ b/src/AV/Output/AudioEncoder.cpp
+@@ -77,7 +77,8 @@ unsigned int AudioEncoder::GetSampleRate() {
+ }
+ 
+ bool AudioEncoder::AVCodecIsSupported(const QString& codec_name) {
+-	AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData());
++	// we have to break const correctness for compatibility with older ffmpeg versions
++	AVCodec *codec = (AVCodec*) avcodec_find_encoder_by_name(codec_name.toUtf8().constData());
+ 	if(codec == NULL)
+ 		return false;
+ 	if(!av_codec_is_encoder(codec))
+diff --git a/src/AV/Output/Muxer.cpp b/src/AV/Output/Muxer.cpp
+index ad583803..bc6dd71c 100644
+--- a/src/AV/Output/Muxer.cpp
++++ b/src/AV/Output/Muxer.cpp
+@@ -194,7 +194,8 @@ unsigned int Muxer::GetQueuedPacketCount(unsigned int stream_index) {
+ void Muxer::Init() {
+ 
+ 	// get the format we want (this is just a pointer, we don't have to free this)
+-	AVOutputFormat *format = av_guess_format(m_container_name.toUtf8().constData(), NULL, NULL);
++	// we have to break const correctness for compatibility with older ffmpeg versions
++	AVOutputFormat *format = (AVOutputFormat*) av_guess_format(m_container_name.toUtf8().constData(), NULL, NULL);
+ 	if(format == NULL) {
+ 		Logger::LogError("[Muxer::Init] " + Logger::tr("Error: Can't find chosen output format!"));
+ 		throw LibavException();
+@@ -262,7 +263,8 @@ void Muxer::Free() {
+ }
+ 
+ AVCodec* Muxer::FindCodec(const QString& codec_name) {
+-	AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData());
++	// we have to break const correctness for compatibility with older ffmpeg versions
++	AVCodec *codec = (AVCodec*) avcodec_find_encoder_by_name(codec_name.toUtf8().constData());
+ 	if(codec == NULL) {
+ 		Logger::LogError("[Muxer::FindCodec] " + Logger::tr("Error: Can't find codec!"));
+ 		throw LibavException();
+diff --git a/src/AV/Output/VideoEncoder.cpp b/src/AV/Output/VideoEncoder.cpp
+index 8087e8ed..d09d7047 100644
+--- a/src/AV/Output/VideoEncoder.cpp
++++ b/src/AV/Output/VideoEncoder.cpp
+@@ -95,7 +95,8 @@ unsigned int VideoEncoder::GetFrameRate() {
+ }
+ 
+ bool VideoEncoder::AVCodecIsSupported(const QString& codec_name) {
+-	AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData());
++	// we have to break const correctness for compatibility with older ffmpeg versions
++	AVCodec *codec = (AVCodec*) avcodec_find_encoder_by_name(codec_name.toUtf8().constData());
+ 	if(codec == NULL)
+ 		return false;
+ 	if(!av_codec_is_encoder(codec))
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/simplescreenrecorder.git/commitdiff/6cc1b2f27d340fb91b8c9137209b795498ead54b



More information about the pld-cvs-commit mailing list