Overview

Request 5781 (accepted)

- Apply upstream pull request 8376.patch to fix build with ffmpeg >= 6

- Disable __requires_exclude_from for testing

Submit package home:frispete / obs-studio to package Multimedia / obs-studio

obs-studio.changes Changed
x
 
1
@@ -1,4 +1,14 @@
2
 -------------------------------------------------------------------
3
+Fri May 12 14:27:03 UTC 2023 - Hans-Peter Jansen <hp@urpla.net>
4
+
5
+- Apply upstream pull request 8376.patch to fix build with ffmpeg >= 6
6
+
7
+-------------------------------------------------------------------
8
+Sat Apr 22 16:16:29 UTC 2023 - Hans-Peter Jansen <hpj@urpla.net>
9
+
10
+- Disable __requires_exclude_from for testing
11
+
12
+-------------------------------------------------------------------
13
 Tue Apr 18 16:52:06 UTC 2023 - Hans-Peter Jansen <hp@urpla.net>
14
 
15
 - Add more hidden deps
16
obs-studio.spec Changed
18
 
1
@@ -20,6 +20,7 @@
2
 %endif
3
 Patch0:         0002-Include-diverse-luajit.patch
4
 Patch1:         0001-Prefix-modinfo-with-sbin-since-not-in-normal-path.patch
5
+Patch2:         8376.patch
6
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
7
 BuildRequires:  update-desktop-files
8
 BuildRequires:  cmake >= 2.8.12
9
@@ -81,7 +82,7 @@
10
 
11
 # these are plugins, built as libs and as such should not be mixed up with their originals
12
 %global __provides_exclude_from ^(%{_libdir}/obs-plugins/.*\\.so.*|%{_libdir}/obs-scripting/.*\\.so.*)$
13
-%global __requires_exclude_from ^(%{_libdir}/obs-plugins/.*|%{_libdir}/obs-scripting/.*)$
14
+#%%global __requires_exclude_from ^(%%{_libdir}/obs-plugins/.*|%%{_libdir}/obs-scripting/.*)$
15
 %global __requires_exclude ^libcef\\.so$
16
 
17
 %description
18
8376.patch Added
98
 
1
@@ -0,0 +1,96 @@
2
+From 1603aaf4a2ef16b7aabb3cf330c7b3fde77ad8ca Mon Sep 17 00:00:00 2001
3
+From: pkv <pkv@obsproject.com>
4
+Date: Tue, 28 Feb 2023 17:28:38 +0100
5
+Subject: PATCH obs-ffmpeg: Fix for FFmpeg 6 deprecating a flag
6
+
7
+Also modifies libobs & deps/media-playback.
8
+AV_CODEC_CAP_TRUNCATED was removed in avcodec 60 1.
9
+We ifdef the code depending on it to allow compilation.
10
+
11
+1 avcodec: remove FF_API_FLAG_TRUNCATED
12
+https://github.com/FFmpeg/FFmpeg/commit/3ceffe783965767e62d59e8e68ecd265c98460ec
13
+
14
+Signed-off-by: pkv <pkv@obsproject.com>
15
+---
16
+ deps/media-playback/media-playback/decode.c | 2 ++
17
+ deps/media-playback/media-playback/decode.h | 2 ++
18
+ libobs/obs-ffmpeg-compat.h                  | 2 ++
19
+ plugins/obs-ffmpeg/obs-ffmpeg-compat.h      | 2 ++
20
+ plugins/win-dshow/ffmpeg-decode.c           | 2 ++
21
+ 5 files changed, 10 insertions(+)
22
+
23
+diff --git a/deps/media-playback/media-playback/decode.c b/deps/media-playback/media-playback/decode.c
24
+index 05d6afcc649a2..e1aa9aec0577b 100644
25
+--- a/deps/media-playback/media-playback/decode.c
26
++++ b/deps/media-playback/media-playback/decode.c
27
+@@ -230,8 +230,10 @@ bool mp_decode_init(mp_media_t *m, enum AVMediaType type, bool hw)
28
+       d->in_frame = d->sw_frame;
29
+   }
30
+ 
31
++#if LIBAVCODEC_VERSION_MAJOR < 60
32
+   if (d->codec->capabilities & CODEC_CAP_TRUNC)
33
+       d->decoder->flags |= CODEC_FLAG_TRUNC;
34
++#endif
35
+ 
36
+   d->orig_pkt = av_packet_alloc();
37
+   d->pkt = av_packet_alloc();
38
+diff --git a/deps/media-playback/media-playback/decode.h b/deps/media-playback/media-playback/decode.h
39
+index 1ca271b419fbd..6da34061b3dee 100644
40
+--- a/deps/media-playback/media-playback/decode.h
41
++++ b/deps/media-playback/media-playback/decode.h
42
+@@ -37,8 +37,10 @@ extern "C" {
43
+ #endif
44
+ 
45
+ #if LIBAVCODEC_VERSION_MAJOR >= 58
46
++#if LIBAVCODEC_VERSION_MAJOR < 60
47
+ #define CODEC_CAP_TRUNC AV_CODEC_CAP_TRUNCATED
48
+ #define CODEC_FLAG_TRUNC AV_CODEC_FLAG_TRUNCATED
49
++#endif
50
+ #else
51
+ #define CODEC_CAP_TRUNC CODEC_CAP_TRUNCATED
52
+ #define CODEC_FLAG_TRUNC CODEC_FLAG_TRUNCATED
53
+diff --git a/libobs/obs-ffmpeg-compat.h b/libobs/obs-ffmpeg-compat.h
54
+index c4e23b9851242..ad633521e3b0b 100644
55
+--- a/libobs/obs-ffmpeg-compat.h
56
++++ b/libobs/obs-ffmpeg-compat.h
57
+@@ -23,8 +23,10 @@
58
+ #endif
59
+ 
60
+ #if LIBAVCODEC_VERSION_MAJOR >= 58
61
++#if LIBAVCODEC_VERSION_MAJOR < 60
62
+ #define CODEC_CAP_TRUNC AV_CODEC_CAP_TRUNCATED
63
+ #define CODEC_FLAG_TRUNC AV_CODEC_FLAG_TRUNCATED
64
++#endif
65
+ #define INPUT_BUFFER_PADDING_SIZE AV_INPUT_BUFFER_PADDING_SIZE
66
+ #else
67
+ #define CODEC_CAP_TRUNC CODEC_CAP_TRUNCATED
68
+diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-compat.h b/plugins/obs-ffmpeg/obs-ffmpeg-compat.h
69
+index 181167aff383d..39efa00c774b3 100644
70
+--- a/plugins/obs-ffmpeg/obs-ffmpeg-compat.h
71
++++ b/plugins/obs-ffmpeg/obs-ffmpeg-compat.h
72
+@@ -27,8 +27,10 @@
73
+ #endif
74
+ 
75
+ #if LIBAVCODEC_VERSION_MAJOR >= 58
76
++#if LIBAVCODEC_VERSION_MAJOR < 60
77
+ #define CODEC_CAP_TRUNC AV_CODEC_CAP_TRUNCATED
78
+ #define CODEC_FLAG_TRUNC AV_CODEC_FLAG_TRUNCATED
79
++#endif
80
+ #define CODEC_FLAG_GLOBAL_H AV_CODEC_FLAG_GLOBAL_HEADER
81
+ #else
82
+ #define CODEC_CAP_TRUNC CODEC_CAP_TRUNCATED
83
+diff --git a/plugins/win-dshow/ffmpeg-decode.c b/plugins/win-dshow/ffmpeg-decode.c
84
+index d27c98441da15..49df62b7a79f2 100644
85
+--- a/plugins/win-dshow/ffmpeg-decode.c
86
++++ b/plugins/win-dshow/ffmpeg-decode.c
87
+@@ -105,8 +105,10 @@ int ffmpeg_decode_init(struct ffmpeg_decode *decode, enum AVCodecID id,
88
+       return ret;
89
+   }
90
+ 
91
++#if LIBAVCODEC_VERSION_MAJOR < 60
92
+   if (decode->codec->capabilities & CODEC_CAP_TRUNC)
93
+       decode->decoder->flags |= CODEC_FLAG_TRUNC;
94
++#endif
95
+ 
96
+   return 0;
97
+ }
98
Refresh
Refresh

frispete

frispete wrote almost 2 years ago

I'm inclined to accept it in order to try this approach with our delicate audience. What do you think?


boombatower

boombatower wrote almost 2 years ago

I don't recall what that was for at this point.

Request History
frispete's avatar

frispete created request almost 2 years ago

- Apply upstream pull request 8376.patch to fix build with ffmpeg >= 6

- Disable __requires_exclude_from for testing


frispete's avatar

frispete accepted request almost 2 years ago

Now, that the Leap build issues are settled, let's update the build for OBS with ffmpeg 6.