andreas pushed a commit to branch qt-team
in repository guix.

commit 8cfc8709f3dccf36a6f6360fec4b9908338f4b18
Author: 宋文武 <iyzs...@member.fsf.org>
AuthorDate: Fri Feb 7 18:02:06 2025 +0800

    gnu: ffmpeg: Add 'av_stream_get_first_dts' patch for QtWebEngine.
    
    * 
gnu/packages/patches/ffmpeg-add-av_stream_get_first_dts-for-chromium.patch:
    New patch.
    * gnu/local.mk (dist_patch_DATA): Add it.
    * gnu/packages/video.scm (ffmpeg) [patches]: Add it.
    
    Change-Id: I819076f8eb1cd2d62f2bbf18c7ceee10cb59adba
---
 gnu/local.mk                                       |  1 +
 ...-add-av_stream_get_first_dts-for-chromium.patch | 37 ++++++++++++++++++++++
 gnu/packages/video.scm                             |  5 ++-
 3 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 835c183d4f..94f8602e1c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1282,6 +1282,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/fenics-dolfin-demo-init.patch           \
   %D%/packages/patches/fenics-dolfin-boost.patch               \
   %D%/packages/patches/fenics-dolfin-config-slepc.patch                \
+  %D%/packages/patches/ffmpeg-add-av_stream_get_first_dts-for-chromium.patch   
\
   %D%/packages/patches/ffmpeg-jami-change-RTCP-ratio.patch     \
   %D%/packages/patches/ffmpeg-jami-rtp_ext_abs_send_time.patch \
   %D%/packages/patches/ffmpeg-jami-libopusdec-enable-FEC.patch \
diff --git 
a/gnu/packages/patches/ffmpeg-add-av_stream_get_first_dts-for-chromium.patch 
b/gnu/packages/patches/ffmpeg-add-av_stream_get_first_dts-for-chromium.patch
new file mode 100644
index 0000000000..f6cb278e9b
--- /dev/null
+++ b/gnu/packages/patches/ffmpeg-add-av_stream_get_first_dts-for-chromium.patch
@@ -0,0 +1,37 @@
+Add 'av_stream_get_first_dts' for Chromium and QtWebEngine.
+
+Taken from Arch Linux:
+  
<https://gitlab.archlinux.org/archlinux/packaging/packages/ffmpeg/-/blob/a02c1a15706ea832c0d52a4d66be8fb29499801a/add-av_stream_get_first_dts-for-chromium.patch>
+
+---
+diff '--color=auto' -rupN ffmpeg.orig/libavformat/avformat.h 
ffmpeg/libavformat/avformat.h
+--- ffmpeg.orig/libavformat/avformat.h 2022-08-19 17:42:47.323422603 +0200
++++ ffmpeg/libavformat/avformat.h      2022-08-19 17:42:51.347130436 +0200
+@@ -1128,6 +1128,10 @@ struct AVCodecParserContext *av_stream_g
+  */
+ int64_t    av_stream_get_end_pts(const AVStream *st);
+ 
++// 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 '--color=auto' -rupN ffmpeg.orig/libavformat/mux_utils.c 
ffmpeg/libavformat/mux_utils.c
+--- ffmpeg.orig/libavformat/mux_utils.c        2022-08-19 17:42:47.346758108 
+0200
++++ ffmpeg/libavformat/mux_utils.c     2022-08-19 17:47:28.549589002 +0200
+@@ -37,6 +37,13 @@ int64_t av_stream_get_end_pts(const AVSt
+         return AV_NOPTS_VALUE;
+ }
+ 
++// 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 ^^^
++
+ int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id,
+                          int std_compliance)
+ {
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 37a584de03..890b141a97 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -1893,7 +1893,10 @@ audio/video codec library.")
                                   version ".tar.xz"))
               (sha256
                (base32
-                "0s7r2qv8gh2a3w568n9xxgcz0q8j5ww1jdsci1hm9f4l1yqg9146"))))))
+                "0s7r2qv8gh2a3w568n9xxgcz0q8j5ww1jdsci1hm9f4l1yqg9146"))
+              (patches
+               (search-patches
+                "ffmpeg-add-av_stream_get_first_dts-for-chromium.patch"))))))
 
 (define-public ffmpeg-5
   (package

Reply via email to