commit 20491ec88ec563faf28c9419eac9d987a8b57778
Author: leigh123linux <leigh123linux(a)googlemail.com>
Date: Thu Jan 18 03:41:24 2018 +0000
fix build with ffmpeg-3.5
ffmpeg35_buildfix.patch.patch | 61 +++++++++++++++++++++++++++++++++++++++++++
simplescreenrecorder.spec | 3 ++-
2 files changed, 63 insertions(+), 1 deletion(-)
---
diff --git a/ffmpeg35_buildfix.patch.patch b/ffmpeg35_buildfix.patch.patch
new file mode 100644
index 0000000..50dbde0
--- /dev/null
+++ b/ffmpeg35_buildfix.patch.patch
@@ -0,0 +1,61 @@
+--- a/src/AV/Output/BaseEncoder.cpp
++++ b/src/AV/Output/BaseEncoder.cpp
+@@ -214,7 +214,7 @@
+ }
+
+ // flush the encoder
+- if(!m_should_stop && (m_codec_context->codec->capabilities &
CODEC_CAP_DELAY)) {
++ if(!m_should_stop && (m_codec_context->codec->capabilities &
AV_CODEC_CAP_DELAY)) {
+ Logger::LogInfo("[BaseEncoder::EncoderThread] " + Logger::tr("Flushing
encoder ..."));
+ while(!m_should_stop) {
+ if(!EncodeFrame(NULL)) {
+
+--- a/src/AV/Output/Muxer.cpp
++++ b/src/AV/Output/Muxer.cpp
+@@ -314,10 +314,10 @@
+
+ // not sure why this is needed, but it's in the example code and it doesn't
work without this
+ if(m_format_context->oformat->flags & AVFMT_GLOBALHEADER)
+- (*codec_context)->flags |= CODEC_FLAG_GLOBAL_HEADER;
++ (*codec_context)->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+
+ // if the codec is experimental, allow it
+- if(codec->capabilities & CODEC_CAP_EXPERIMENTAL) {
++ if(codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) {
+ Logger::LogWarning("[Muxer::AddStream] " + Logger::tr("Warning: This
codec is considered experimental by libav/ffmpeg."));
+ (*codec_context)->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
+ }
+
+--- a/src/AV/Output/AudioEncoder.cpp
++++ b/src/AV/Output/AudioEncoder.cpp
+@@ -59,7 +59,7 @@
+
+ unsigned int AudioEncoder::GetFrameSize() {
+ #if SSR_USE_AVCODEC_ENCODE_AUDIO2
+- return (GetCodecContext()->codec->capabilities &
CODEC_CAP_VARIABLE_FRAME_SIZE)? DEFAULT_FRAME_SAMPLES : GetCodecContext()->frame_size;
++ return (GetCodecContext()->codec->capabilities &
AV_CODEC_CAP_VARIABLE_FRAME_SIZE)? DEFAULT_FRAME_SAMPLES :
GetCodecContext()->frame_size;
+ #else
+ return (GetCodecContext()->frame_size <= 1)? DEFAULT_FRAME_SAMPLES :
GetCodecContext()->frame_size;
+ #endif
+@@ -123,7 +123,7 @@
+ if(key == "threads") {
+ codec_context->thread_count = ParseCodecOptionInt(key, value, 1, 100);
+ } else if(key == "qscale") {
+- codec_context->flags |= CODEC_FLAG_QSCALE;
++ codec_context->flags |= AV_CODEC_FLAG_QSCALE;
+ codec_context->global_quality = lrint(ParseCodecOptionDouble(key, value, -1.0e6,
1.0e6, FF_QP2LAMBDA));
+ } else if(key == "sampleformat") {
+ sample_format_name = value;
+
+--- a/src/AV/Output/VideoEncoder.cpp
++++ b/src/AV/Output/VideoEncoder.cpp
+@@ -131,7 +131,7 @@
+ if(key == "threads") {
+ codec_context->thread_count = ParseCodecOptionInt(key, value, 1, 100);
+ } else if(key == "qscale") {
+- codec_context->flags |= CODEC_FLAG_QSCALE;
++ codec_context->flags |= AV_CODEC_FLAG_QSCALE;
+ codec_context->global_quality = lrint(ParseCodecOptionDouble(key, value, -1.0e6,
1.0e6, FF_QP2LAMBDA));
+ } else if(key == "minrate") {
+ codec_context->rc_min_rate = ParseCodecOptionInt(key, value, 1, 1000000, 1000); //
kbit/s
+
diff --git a/simplescreenrecorder.spec b/simplescreenrecorder.spec
index 4930976..610e0e9 100644
--- a/simplescreenrecorder.spec
+++ b/simplescreenrecorder.spec
@@ -7,6 +7,7 @@ Summary: Simple Screen Recorder is a screen recorder for Linux
License: GPLv3
URL:
http://www.maartenbaert.be/simplescreenrecorder/
Source0:
https://github.com/MaartenBaert/ssr/archive/%{version}.tar.gz
+Patch0: ffmpeg35_buildfix.patch.patch
BuildRequires: desktop-file-utils
BuildRequires: cmake3
@@ -36,7 +37,7 @@ Despite the name, this program is actually quite complex.
It's 'simple' in the sense that it's easier to use than ffmpeg/avconv or
VLC
%prep
-%autosetup -n %{shortname}-%{version}
+%autosetup -p1 -n %{shortname}-%{version}
%build