commit fe9f19c0cfd53fc932234fded603fec7f9084c6c
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Wed Nov 15 17:05:19 2023 +0000
Add patch to fix fedora ffmpeg broken ABI change
ffmpeg-chromium.patch | 46 ++++++++++++++++++++++++++++++++++++++++++++++
ffmpeg.spec | 2 ++
2 files changed, 48 insertions(+)
---
diff --git a/ffmpeg-chromium.patch b/ffmpeg-chromium.patch
new file mode 100644
index 0000000..2160609
--- /dev/null
+++ b/ffmpeg-chromium.patch
@@ -0,0 +1,46 @@
+From d32aacab65a322b66d6a1b48f6cdb03e42bde0f9 Mon Sep 17 00:00:00 2001
+From: Frank Liberato <liberato(a)chromium.org>
+Date: Wed, 7 Jul 2021 19:01:22 -0700
+Subject: [PATCH] Add av_stream_get_first_dts for Chromium
+
+---
+ libavformat/avformat.h | 4 ++++
+ libavformat/utils.c | 7 +++++++
+ 2 files changed, 11 insertions(+)
+
+diff --git a/libavformat/avformat.h b/libavformat/avformat.h
+index 1916aa2dc5..e6682849fa 100644
+--- a/libavformat/avformat.h
++++ b/libavformat/avformat.h
+@@ -1019,6 +1019,10 @@ attribute_deprecated
+ int64_t av_stream_get_end_pts(const AVStream *st);
+ #endif
+
++// Chromium: We use the internal field first_dts vvv
++int64_t av_stream_get_first_dts(const AVStream *st);
++// Chromium: We use the internal field first_dts ^^^
++
+ #define AV_PROGRAM_RUNNING 1
+
+ /**
+diff --git a/libavformat/utils.c b/libavformat/utils.c
+index cf4d68bff9..7d750abf88 100644
+--- a/libavformat/utils.c
++++ b/libavformat/utils.c
+@@ -55,6 +55,13 @@ int ff_unlock_avformat(void)
+ return ff_mutex_unlock(&avformat_mutex) ? -1 : 0;
+ }
+
++// Chromium: We use the internal field first_dts vvv
++int64_t av_stream_get_first_dts(const AVStream *st)
++{
++ return cffstream(st)->first_dts;
++}
++// Chromium: We use the internal field first_dts ^^^
++
+ /* an arbitrarily chosen "sane" max packet size -- 50M */
+ #define SANE_CHUNK_SIZE (50000000)
+
+--
+2.41.0
+
diff --git a/ffmpeg.spec b/ffmpeg.spec
index b2db794..2538b1a 100644
--- a/ffmpeg.spec
+++ b/ffmpeg.spec
@@ -122,6 +122,8 @@ Source0:
https://ffmpeg.org/releases/ffmpeg-%{version}.tar.xz
Source1:
https://ffmpeg.org/releases/ffmpeg-%{version}.tar.xz.asc
Source2:
https://ffmpeg.org/ffmpeg-devel.asc
%endif
+# We don't endorse adding this patch but fedora insists on breaking the ffmpeg ABI
+Patch0: ffmpeg-chromium.patch
Conflicts: %{name}-free
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%{?_with_cuda:BuildRequires: cuda-minimal-build-%{_cuda_version_rpm} cuda-drivers-devel}