7
0
Files
nodejs-electron/chromium-ffmpeg-first-dts.patch
Bruno Pitrus 7b259750d2 Accepting request 1110783 from home:dziobian:gulgul-ultron:19
- Update to 25.8.0
  * ABI break: NODE_MODULE_VERSION is now 116
  * Chromium 114.0.5735.289
  * Node 18.15.0
  * V8 11.4
  * Removed BrowserWindow scroll-touch-* events (since Electron 23)
  * Removed webContents.{de,in}crementCapturerCount(stayHidden, stayAwake) (since Electron 23)
  * Removed JXL image format support (since Electron 23)
  * API Changed: nativeImage.createThumbnailFromPath(path, size) (since Electron 24)
- Use bundled vpx on Fedora ≤37 and Leap
- Use bundled aom on Fedora and Leap
- Drop support for Fedora 36 which is EOL
- Drop upstreamed patches
  * CVE-2022-43548.patch
  * aggregatable_attribution_utils-do-not-assume-abseil-ABI.patch
  * angle-ShaderVars-missing-uint32_t.patch
  * blink-gcc13-missing-headers.patch
  * bluetooth_uuid-missing-uint8_t.patch
  * broker_file_permission-missing-uint64_t.patch
  * chromium-108-abseil-shims.patch
  * components-gcc13-missing-headers.patch 
  * crashpad-elf_image_reader-ProgramHeaderTableSpecific-expected-unqualified-id.patch
  * d0aa9ad.patch
  * document_loader-private-DecodedBodyData.patch
  * effect_paint_property_node-Wchanges-meaning.patch
  * electron_serial_delegate-ambiguous-Observer.patch
  * extensions-gcc13-missing-headers.patch
  * first_party_set_parser-IssueWithMetadata-no-known-conversion.patch
  * gpu_feature_info-missing-uint32_t.patch
  * half_float-Wstrict-aliasing.patch
  * ipcz-buffer_id-Wnarrowing.patch
  * ipcz-safe_math-Wuninitialized.patch
  * net-gcc13-missing-headers.patch
  * net-third_party-quiche-gcc13-missing-headers.patch
  * one_writer_seqlock-missing-uintptr_t.patch
  * openscreen-gcc13-missing-headers.patch
  * passwords_counter-Wsubobject-linkage.patch
  * perfetto-uuid-missing-uint8_t.patch
  * print_dialog_gtk-no-kEnableOopPrintDriversJobPrint.patch
  * profiler-missing-uintptr_t.patch
  * reproducible-config.gypi.patch
  * select_file_dialog_linux_kde-Wodr.patch
  * shim_headers-fix-ninja.patch
  * static_constructors-Wstrict-aliasing.patch
  * string_hasher-type-pun-UB-causes-heap-corruption.patch
  * swiftshader-Constants-Wstrict-aliasing.patch
  * swiftshader-Half-Wstrict-aliasing.patch
  * swiftshader-LRUCache-missing-uint64_t.patch
  * target_property-missing-uint32_t.patch
  * ui-gcc13-missing-headers.patch
  * unzip-Wsubobject-linkage.patch
  * v8_initializer-PageAllocator-fpermissive.patch
  * vector_math_impl-Wstrict-aliasing.patch
  * web_contents_impl-Wsubobject-linkage.patch
  * webgl_image_conversion-Wstrict-aliasing.patch
  * webrtc-base64-missing-uint8_t.patch
  * xr_cube_map-Wstrict-aliasing.patch
- Drop no longer relevant patches`
  * chromium-norar.patch
  * electron-13-fix-sql-virtualcursor-type.patch
  * enable-jxl.patch
  * system-jsoncpp.patch
- Add patches to build with system libs
  * abseil-remove-unused-targets.patch
  * highway.gn
  * system-wayland.patch
- Add patches to fix build errors
  * absl-uint128-do-not-assume-abi.patch
  * cpu-missing-uint8_t.patch
  * electron-24-components-missing-headers.patch
  * electron_api_app-GetPathConstant-non-constexpr.patch
  * electron_browser_context-missing-variant.patch
  * mojo_ukm_recorder-missing-WrapUnique.patch
- Conditionally reverse upstream changes to build against stable avif
  * avif_image_decoder-repetitionCount-clli.patch
- …and harfbuzz 4
  * harfbuzz-replace-HbScopedPointer.patch
- …and icu 69
  * v8-regexp-parser-UCHAR_BASIC_EMOJI.patch
- …and wayland 19
  * wayland-WL-SINCE-VERSION.patch
  * wayland_data_drag_controller-WL_SURFACE_OFFSET_SINCE_VERSION.patch
- Add backported chrome-gpu-does-not-load.patch

OBS-URL: https://build.opensuse.org/request/show/1110783
OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=89
2023-09-13 04:57:45 +00:00

121 lines
4.8 KiB
Diff

From 2aef9000a1c8d76d3072365ffcb471ebffa20d3d Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@cryptomilk.org>
Date: Tue, 15 Mar 2022 14:26:16 +0100
Subject: [PATCH] Track first_dts instead of using non-upstream functions
The function av_stream_get_first_dts() is not an upstream ffmpeg function and
is not available if you build with system ffmpeg. We can easily track the
first_dts on our own.
See also
https://ffmpeg.org/pipermail/ffmpeg-devel/2021-September/285401.html
Bug: 1306560
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Change-Id: I90ba3cf2f2e16f56a0b405f26c67f911349fb71d
---
media/filters/ffmpeg_demuxer.cc | 18 ++++++++++++------
media/filters/ffmpeg_demuxer.h | 3 +++
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index 111899b661..799fc6e941 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -97,7 +97,7 @@ static base::TimeDelta FramesToTimeDelta(int frames, double sample_rate) {
sample_rate);
}
-static base::TimeDelta ExtractStartTime(AVStream* stream) {
+static base::TimeDelta ExtractStartTime(AVStream* stream, int64_t first_dts) {
// The default start time is zero.
base::TimeDelta start_time;
@@ -107,12 +107,12 @@ static base::TimeDelta ExtractStartTime(AVStream* stream) {
// Next try to use the first DTS value, for codecs where we know PTS == DTS
// (excludes all H26x codecs). The start time must be returned in PTS.
- if (av_stream_get_first_dts(stream) != kNoFFmpegTimestamp &&
+ if (first_dts != AV_NOPTS_VALUE &&
stream->codecpar->codec_id != AV_CODEC_ID_HEVC &&
stream->codecpar->codec_id != AV_CODEC_ID_H264 &&
stream->codecpar->codec_id != AV_CODEC_ID_MPEG4) {
const base::TimeDelta first_pts =
- ConvertFromTimeBase(stream->time_base, av_stream_get_first_dts(stream));
+ ConvertFromTimeBase(stream->time_base, first_dts);
if (first_pts < start_time)
start_time = first_pts;
}
@@ -283,6 +283,7 @@ FFmpegDemuxerStream::FFmpegDemuxerStream(
fixup_negative_timestamps_(false),
fixup_chained_ogg_(false),
num_discarded_packet_warnings_(0),
+ first_dts_(AV_NOPTS_VALUE),
last_packet_pos_(AV_NOPTS_VALUE),
last_packet_dts_(AV_NOPTS_VALUE) {
DCHECK(demuxer_);
@@ -349,6 +350,10 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
int64_t packet_dts =
packet->dts == AV_NOPTS_VALUE ? packet->pts : packet->dts;
+ if (first_dts_ == AV_NOPTS_VALUE) {
+ first_dts_ = packet_dts;
+ }
+
// Chained ogg files have non-monotonically increasing position and time stamp
// values, which prevents us from using them to determine if a packet should
// be dropped. Since chained ogg is only allowed on single track audio only
@@ -1442,7 +1447,8 @@ void FFmpegDemuxer::OnFindStreamInfoDone(int result) {
max_duration = std::max(max_duration, streams_[i]->duration());
- base::TimeDelta start_time = ExtractStartTime(stream);
+ base::TimeDelta start_time =
+ ExtractStartTime(stream, streams_[i]->first_dts());
// Note: This value is used for seeking, so we must take the true value and
// not the one possibly clamped to zero below.
@@ -1599,7 +1605,7 @@ FFmpegDemuxerStream* FFmpegDemuxer::FindStreamWithLowestStartTimestamp(
for (const auto& stream : streams_) {
if (!stream || stream->IsEnabled() != enabled)
continue;
- if (av_stream_get_first_dts(stream->av_stream()) == kInvalidPTSMarker)
+ if (stream->first_dts() == AV_NOPTS_VALUE)
continue;
if (!lowest_start_time_stream ||
stream->start_time() < lowest_start_time_stream->start_time()) {
@@ -1620,7 +1626,7 @@ FFmpegDemuxerStream* FFmpegDemuxer::FindPreferredStreamForSeeking(
if (stream->type() != DemuxerStream::VIDEO)
continue;
- if (av_stream_get_first_dts(stream->av_stream()) == kInvalidPTSMarker)
+ if (stream->first_dts() == AV_NOPTS_VALUE)
continue;
if (!stream->IsEnabled())
diff --git a/media/filters/ffmpeg_demuxer.h b/media/filters/ffmpeg_demuxer.h
index c147309d6f..48a8f6ad8c 100644
--- a/media/filters/ffmpeg_demuxer.h
+++ b/media/filters/ffmpeg_demuxer.h
@@ -151,6 +151,8 @@ class MEDIA_EXPORT FFmpegDemuxerStream : public DemuxerStream {
base::TimeDelta start_time() const { return start_time_; }
void set_start_time(base::TimeDelta time) { start_time_ = time; }
+ int64_t first_dts() const { return first_dts_; }
+
private:
friend class FFmpegDemuxerTest;
@@ -208,6 +210,7 @@ class MEDIA_EXPORT FFmpegDemuxerStream : public DemuxerStream {
bool fixup_chained_ogg_;
int num_discarded_packet_warnings_;
+ int64_t first_dts_;
int64_t last_packet_pos_;
int64_t last_packet_dts_;
// Requested buffer count. The actual returned buffer count could be less
--
2.35.1