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
This commit is contained in:
宋文武 2025-02-07 18:02:06 +08:00 committed by Andreas Enge
parent c54715b14d
commit b8e3696fc5
No known key found for this signature in database
GPG key ID: F7D5C9BF765C61E3
3 changed files with 42 additions and 1 deletions

View file

@ -1297,6 +1297,7 @@ dist_patch_DATA = \
%D%/packages/patches/fenics-dolfin-boost.patch \
%D%/packages/patches/fenics-dolfin-config-slepc.patch \
%D%/packages/patches/fenics-dolfin-hdf5-version-check.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 \

View file

@ -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)
{

View file

@ -1863,7 +1863,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