#17 Add a patch to be compatible with qt5-webengine
Closed 2 months ago by imbearchild. Opened 2 months ago by imbearchild.
rpms/ imbearchild/ffmpeg rawhide  into  rawhide

@@ -0,0 +1,45 @@ 

+ commit	95aab0fd83619408995720ce53d7a74790580220

+ author	liberato@chromium.org <liberato@chromium.org>	Thu Jul 08 02:01:22 2021

+ committer	liberato@chromium.org <liberato@chromium.org>	Thu Jul 08 02:01:22 2021

+ tree	ac725b5e2c548c8142aa7096d8184d87d3876a49

+ parent	e073b7a22e4993e0a7cab80a42a21524e5349f95

+ 

+ Add av_stream_get_first_dts for Chromium

+ 

+ ---

+  libavformat/avformat.h    |    4 ++++

+  libavformat/utils.c |    7 +++++++

+  2 files changed, 11 insertions(+)

+ 

+ Index: ffmpeg-5.1.3/libavformat/avformat.h

+ ===================================================================

+ --- ffmpeg-5.1.3.orig/libavformat/avformat.h

+ +++ ffmpeg-5.1.3/libavformat/avformat.h

+ @@ -1128,6 +1128,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

+ 

+  /**

+ Index: ffmpeg-5.1.3/libavformat/utils.c

+ ===================================================================

+ --- ffmpeg-5.1.3.orig/libavformat/utils.c

+ +++ ffmpeg-5.1.3/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)

file modified
+7 -1
@@ -92,7 +92,7 @@ 

  %global pkg_name %{name}%{?pkg_suffix}

  

  Version:        6.0

- Release:        6%{?dist}

+ Release:        7%{?dist}

  Summary:        A complete solution to record, convert and stream audio and video

  License:        GPL-3.0-or-later

  URL:            https://ffmpeg.org/
@@ -125,6 +125,9 @@ 

  # Set up dlopen for openh264

  Patch1001:      ffmpeg-dlopen-openh264.patch

  

+ # Add patch for qt-webengine

+ Patch500:       ffmpeg-chromium.patch

+ 

  Requires:       libavcodec%{?pkg_suffix}%{_isa} = %{version}-%{release}

  Requires:       libavdevice%{?pkg_suffix}%{_isa} = %{version}-%{release}

  Requires:       libavfilter%{?pkg_suffix}%{_isa} = %{version}-%{release}
@@ -854,6 +857,9 @@ 

  %{_mandir}/man3/libswscale.3*

  

  %changelog

+ * Mon Jun 12 2023 Nianqing Yao <imbearchild@outlook.com> - 6.0-7

+ - Add a patch to be compatible with qt5-webengine

+ 

  * Mon Jun 12 2023 Dominik Mierzejewski <dominik@greysector.net> - 6.0-6

  - Rebuild for libdc1394

  

We need a patch for ffmpeg to enable system-ffmpeg flag when building
qt5-webengine.

See:
https://bugs.gentoo.org/831487
https://ffmpeg.org/pipermail/ffmpeg-devel/2021-September/285401.html

See https://bugs.chromium.org/p/chromium/issues/detail?id=1306560
and https://chromium-review.googlesource.com/c/chromium/src/+/3525614

Thanks for your additional information!

Chromium has this issue fixed (Edited: I found that Chromium project did not merged that change, but some one said "it is fixed in chromium-108" ), but qt5-webengine still uses old chromium source code. We have to use this patch (if we want to avoid bundling old ffmpeg4 with qt5-webengine), unless upstream of qt5-webengine decides to make a back-port from chromium or upgrade it's source code.

And this is what openSUSE and Arch Linux have done in this situation.

If you want to know more about this, please refer to those links:
https://build.opensuse.org/package/view_file/openSUSE:Factory/ffmpeg-5/ffmpeg-chromium.patch?expand=1
https://github.com/archlinux/svntogit-packages/blob/packages/ffmpeg/trunk/add-av_stream_get_first_dts-for-chromium.patch

Pull-Request has been closed by imbearchild

2 months ago
Metadata