chromium/chromium-84.0.4147.89-force-mp3-files-to-have-a-start-time-of-zero.patch

39 lines
1.6 KiB
Diff
Raw Permalink Normal View History

From 192fc3899f76e9487d77895f31df8d2d13bf9619 Mon Sep 17 00:00:00 2001
From: Dale Curtis <dalecurtis@chromium.org>
Date: Fri, 26 Jun 2020 01:10:55 +0000
Subject: [PATCH] Force mp3 files to have a start time of zero.
This will allow us to remove our custom patch which breaks upstream
ffmpeg functionality for unknown reasons.
R=sandersd
Fixed: 1062037
Change-Id: I253011843dee4dd6a8c958b14990ad836a9f1dca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2268221
Auto-Submit: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Dan Sanders <sandersd@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782792}
---
media/filters/ffmpeg_demuxer.cc | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index 01266e1a072..a7ed542b5fc 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -1522,6 +1522,12 @@ void FFmpegDemuxer::OnFindStreamInfoDone(int result) {
if (glue_->container() == container_names::CONTAINER_AVI)
format_context->flags |= AVFMT_FLAG_GENPTS;
+ // FFmpeg will incorrectly adjust the start time of MP3 files into the future
+ // based on discard samples. We were unable to fix this upstream without
+ // breaking ffmpeg functionality. https://crbug.com/1062037
+ if (glue_->container() == container_names::CONTAINER_MP3)
+ start_time_ = base::TimeDelta();
+
// For testing purposes, don't overwrite the timeline offset if set already.
if (timeline_offset_.is_null()) {
timeline_offset_ =