]> git.pld-linux.org Git - packages/simplescreenrecorder.git/blame - ffmpeg4.patch
- fix building with ffmpeg 4.0
[packages/simplescreenrecorder.git] / ffmpeg4.patch
CommitLineData
68d77f5b
JR
1--- ssr-0.3.6/src/Global.h~ 2015-11-02 22:13:49.000000000 +0100
2+++ ssr-0.3.6/src/Global.h 2018-04-29 19:51:10.866406546 +0200
3@@ -326,9 +326,6 @@
4 inline double ToDouble(const AVRational& r) {
5 return (double) r.num / (double) r.den;
6 }
7-inline double ToDouble(const AVFrac& f) {
8- return (double) f.val + (double) f.num / (double) f.den;
9-}
10
11 inline void GroupEnabled(std::initializer_list<QAction*> actions, bool enabled) {
12 for(QAction *a : actions) {
13--- ssr-0.3.6/src/AV/Output/AudioEncoder.cpp~ 2015-11-02 22:13:49.000000000 +0100
14+++ ssr-0.3.6/src/AV/Output/AudioEncoder.cpp 2018-04-29 19:52:26.060460580 +0200
15@@ -59,7 +59,7 @@
16
17 unsigned int AudioEncoder::GetFrameSize() {
18 #if SSR_USE_AVCODEC_ENCODE_AUDIO2
19- return (GetStream()->codec->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)? DEFAULT_FRAME_SAMPLES : GetStream()->codec->frame_size;
20+ return (GetStream()->codec->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)? DEFAULT_FRAME_SAMPLES : GetStream()->codec->frame_size;
21 #else
22 return (GetStream()->codec->frame_size <= 1)? DEFAULT_FRAME_SAMPLES : GetStream()->codec->frame_size;
23 #endif
24@@ -121,7 +121,7 @@
25 if(key == "threads") {
26 stream->codec->thread_count = ParseCodecOptionInt(key, value, 1, 100);
27 } else if(key == "qscale") {
28- stream->codec->flags |= CODEC_FLAG_QSCALE;
29+ stream->codec->flags |= AV_CODEC_FLAG_QSCALE;
30 stream->codec->global_quality = lrint(ParseCodecOptionDouble(key, value, -1.0e6, 1.0e6, FF_QP2LAMBDA));
31 } else if(key == "sampleformat") {
32 sample_format_name = value;
33--- ssr-0.3.6/src/AV/Output/BaseEncoder.cpp~ 2015-11-02 22:13:49.000000000 +0100
34+++ ssr-0.3.6/src/AV/Output/BaseEncoder.cpp 2018-04-29 19:52:56.784084323 +0200
35@@ -207,7 +207,7 @@
36 }
37
38 // flush the encoder
39- if(!m_should_stop && (m_stream->codec->codec->capabilities & CODEC_CAP_DELAY)) {
40+ if(!m_should_stop && (m_stream->codec->codec->capabilities & AV_CODEC_CAP_DELAY)) {
41 Logger::LogInfo("[BaseEncoder::EncoderThread] " + Logger::tr("Flushing encoder ..."));
42 while(!m_should_stop) {
43 if(EncodeFrame(NULL)) {
44--- ssr-0.3.6/src/AV/Output/Muxer.cpp~ 2015-11-02 22:13:49.000000000 +0100
45+++ ssr-0.3.6/src/AV/Output/Muxer.cpp 2018-04-29 19:54:03.428041137 +0200
46@@ -289,10 +289,10 @@
47
48 // not sure why this is needed, but it's in the example code and it doesn't work without this
49 if(m_format_context->oformat->flags & AVFMT_GLOBALHEADER)
50- stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
51+ stream->codec->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
52
53 // if the codec is experimental, allow it
54- if(codec->capabilities & CODEC_CAP_EXPERIMENTAL) {
55+ if(codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) {
56 Logger::LogWarning("[Muxer::AddStream] " + Logger::tr("Warning: This codec is considered experimental by libav/ffmpeg."));
57 stream->codec->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
58 }
59--- ssr-0.3.6/src/AV/Output/VideoEncoder.cpp~ 2015-11-02 22:13:49.000000000 +0100
60+++ ssr-0.3.6/src/AV/Output/VideoEncoder.cpp 2018-04-29 19:54:53.401837201 +0200
61@@ -147,7 +147,7 @@
62 if(key == "threads") {
63 stream->codec->thread_count = ParseCodecOptionInt(key, value, 1, 100);
64 } else if(key == "qscale") {
65- stream->codec->flags |= CODEC_FLAG_QSCALE;
66+ stream->codec->flags |= AV_CODEC_FLAG_QSCALE;
67 stream->codec->global_quality = lrint(ParseCodecOptionDouble(key, value, -1.0e6, 1.0e6, FF_QP2LAMBDA));
68 } else if(key == "minrate") {
69 stream->codec->rc_min_rate = ParseCodecOptionInt(key, value, 1, 1000000, 1024); // kbps
This page took 0.081256 seconds and 4 git commands to generate.