169 lines
6.4 KiB
Diff
169 lines
6.4 KiB
Diff
diff --git a/configure.cmake b/configure.cmake
|
|
index 8f30b34..bbd934e 100644
|
|
--- a/configure.cmake
|
|
+++ b/configure.cmake
|
|
@@ -209,25 +209,6 @@ int main(void){
|
|
}"
|
|
)
|
|
|
|
-qt_config_compile_test(libavformat
|
|
- LABEL "libavformat"
|
|
- LIBRARIES
|
|
- PkgConfig::FFMPEG
|
|
- CODE
|
|
-"
|
|
-#include \"libavformat/version.h\"
|
|
-extern \"C\" {
|
|
-#include \"libavformat/avformat.h\"
|
|
-}
|
|
-int main(void) {
|
|
-#if LIBAVFORMAT_VERSION_MAJOR >= 59
|
|
- AVStream stream;
|
|
- auto first_dts = av_stream_get_first_dts(&stream);
|
|
-#endif
|
|
- return 0;
|
|
-}"
|
|
-)
|
|
-
|
|
#### Features
|
|
|
|
qt_feature("qtwebengine-build" PUBLIC
|
|
@@ -563,11 +544,6 @@ add_check_for_support(
|
|
CONDITION NOT LINUX OR DBUS_FOUND
|
|
MESSAGE "Build requires dbus."
|
|
)
|
|
-add_check_for_support(
|
|
- MODULES QtWebEngine
|
|
- CONDITION NOT LINUX OR NOT QT_FEATURE_webengine_system_ffmpeg OR TEST_libavformat
|
|
- MESSAGE "Unmodified ffmpeg >= 5.0 is not supported."
|
|
-)
|
|
# FIXME: This prevents non XCB Linux builds from building:
|
|
set(xcbSupport X11 LIBDRM XCOMPOSITE XCURSOR XRANDR XI XPROTO XSHMFENCE XTST)
|
|
foreach(xs ${xcbSupport})
|
|
diff --git a/src/3rdparty/chromium/AUTHORS b/src/3rdparty/chromium/AUTHORS
|
|
index ff6abe8..0fd7937 100644
|
|
--- a/src/3rdparty/chromium/AUTHORS
|
|
+++ b/src/3rdparty/chromium/AUTHORS
|
|
@@ -99,6 +99,7 @@ Andra Paraschiv <andra.paraschiv@intel.com>
|
|
Andras Tokodi <a.tokodi@eyeo.com>
|
|
Andreas Nazlidis <andreas221b@gmail.com>
|
|
Andreas Papacharalampous <andreas@apap04.com>
|
|
+Andreas Schneider <asn@cryptomilk.org>
|
|
Andrei Borza <andrei.borza@gmail.com>
|
|
Andrei Parvu <andrei.prv@gmail.com>
|
|
Andrei Parvu <parvu@adobe.com>
|
|
diff --git a/src/3rdparty/chromium/media/filters/ffmpeg_demuxer.cc b/src/3rdparty/chromium/media/filters/ffmpeg_demuxer.cc
|
|
index f41464b..3aa3918 100644
|
|
--- a/src/3rdparty/chromium/media/filters/ffmpeg_demuxer.cc
|
|
+++ b/src/3rdparty/chromium/media/filters/ffmpeg_demuxer.cc
|
|
@@ -59,7 +59,7 @@ namespace media {
|
|
|
|
namespace {
|
|
|
|
-constexpr int64_t kInvalidPTSMarker = static_cast<int64_t>(0x8000000000000000);
|
|
+constexpr int64_t kRelativeTsBase = static_cast<int64_t>(0x7ffeffffffffffff);
|
|
|
|
void SetAVStreamDiscard(AVStream* stream, AVDiscard discard) {
|
|
DCHECK(stream);
|
|
@@ -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) != kInvalidPTSMarker &&
|
|
+ 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;
|
|
}
|
|
@@ -270,6 +270,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_);
|
|
@@ -336,6 +337,11 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
|
|
int64_t packet_dts =
|
|
packet->dts == AV_NOPTS_VALUE ? packet->pts : packet->dts;
|
|
|
|
+ if (first_dts_ == AV_NOPTS_VALUE && packet->dts != AV_NOPTS_VALUE &&
|
|
+ last_packet_dts_ != AV_NOPTS_VALUE) {
|
|
+ first_dts_ = packet->dts - (last_packet_dts_ + kRelativeTsBase);
|
|
+ }
|
|
+
|
|
// 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
|
|
@@ -683,6 +689,7 @@ void FFmpegDemuxerStream::FlushBuffers(bool preserve_packet_position) {
|
|
ResetBitstreamConverter();
|
|
|
|
if (!preserve_packet_position) {
|
|
+ first_dts_ = AV_NOPTS_VALUE;
|
|
last_packet_pos_ = AV_NOPTS_VALUE;
|
|
last_packet_dts_ = AV_NOPTS_VALUE;
|
|
}
|
|
@@ -1452,7 +1459,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.
|
|
@@ -1609,7 +1617,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()) {
|
|
@@ -1630,7 +1638,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/src/3rdparty/chromium/media/filters/ffmpeg_demuxer.h b/src/3rdparty/chromium/media/filters/ffmpeg_demuxer.h
|
|
index 086a795..ba9c665 100644
|
|
--- a/src/3rdparty/chromium/media/filters/ffmpeg_demuxer.h
|
|
+++ b/src/3rdparty/chromium/media/filters/ffmpeg_demuxer.h
|
|
@@ -145,6 +145,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;
|
|
|
|
@@ -202,6 +204,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
|