archrelease: copy trunk to extra-x86_64
[arch-packages.git] / qt5-webengine / repos / extra-x86_64 / qt5-webengine-ffmpeg5.patch
blob58e51d0f4a8a6f694765212b9cae6840a4f9841c
1 diff --git a/chromium/media/ffmpeg/ffmpeg_common.h b/chromium/media/ffmpeg/ffmpeg_common.h
2 index 2734a485cbd..70b1877a43c 100644
3 --- a/chromium/media/ffmpeg/ffmpeg_common.h
4 +++ b/chromium/media/ffmpeg/ffmpeg_common.h
5 @@ -29,6 +29,7 @@ extern "C" {
6 #include <libavformat/avformat.h>
7 #include <libavformat/avio.h>
8 #include <libavutil/avutil.h>
9 +#include <libavutil/channel_layout.h>
10 #include <libavutil/imgutils.h>
11 #include <libavutil/log.h>
12 #include <libavutil/mastering_display_metadata.h>
13 diff --git a/chromium/media/filters/audio_file_reader.cc b/chromium/media/filters/audio_file_reader.cc
14 index cb81d920def..bd73908d0ca 100644
15 --- a/chromium/media/filters/audio_file_reader.cc
16 +++ b/chromium/media/filters/audio_file_reader.cc
17 @@ -85,7 +85,7 @@ bool AudioFileReader::OpenDemuxer() {
20 bool AudioFileReader::OpenDecoder() {
21 - AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
22 + const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
23 if (codec) {
24 // MP3 decodes to S16P which we don't support, tell it to use S16 instead.
25 if (codec_context_->sample_fmt == AV_SAMPLE_FMT_S16P)
26 diff --git a/chromium/media/filters/ffmpeg_audio_decoder.cc b/chromium/media/filters/ffmpeg_audio_decoder.cc
27 index 0d825ed791b..72fac6167ef 100644
28 --- a/chromium/media/filters/ffmpeg_audio_decoder.cc
29 +++ b/chromium/media/filters/ffmpeg_audio_decoder.cc
30 @@ -329,7 +329,7 @@ bool FFmpegAudioDecoder::ConfigureDecoder(const AudioDecoderConfig& config) {
34 - AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
35 + const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
36 if (!codec ||
37 avcodec_open2(codec_context_.get(), codec, &codec_options) < 0) {
38 DLOG(ERROR) << "Could not initialize audio decoder: "
39 diff --git a/chromium/media/filters/ffmpeg_demuxer.cc b/chromium/media/filters/ffmpeg_demuxer.cc
40 index d34db63f3ef..427565b00c1 100644
41 --- a/chromium/media/filters/ffmpeg_demuxer.cc
42 +++ b/chromium/media/filters/ffmpeg_demuxer.cc
43 @@ -98,12 +98,12 @@ static base::TimeDelta ExtractStartTime(AVStream* stream) {
45 // Next try to use the first DTS value, for codecs where we know PTS == DTS
46 // (excludes all H26x codecs). The start time must be returned in PTS.
47 - if (stream->first_dts != kNoFFmpegTimestamp &&
48 + if (av_stream_get_first_dts(stream) != kNoFFmpegTimestamp &&
49 stream->codecpar->codec_id != AV_CODEC_ID_HEVC &&
50 stream->codecpar->codec_id != AV_CODEC_ID_H264 &&
51 stream->codecpar->codec_id != AV_CODEC_ID_MPEG4) {
52 const base::TimeDelta first_pts =
53 - ConvertFromTimeBase(stream->time_base, stream->first_dts);
54 + ConvertFromTimeBase(stream->time_base, av_stream_get_first_dts(stream));
55 if (first_pts < start_time)
56 start_time = first_pts;
58 @@ -408,11 +408,11 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
59 scoped_refptr<DecoderBuffer> buffer;
61 if (type() == DemuxerStream::TEXT) {
62 - int id_size = 0;
63 + size_t id_size = 0;
64 uint8_t* id_data = av_packet_get_side_data(
65 packet.get(), AV_PKT_DATA_WEBVTT_IDENTIFIER, &id_size);
67 - int settings_size = 0;
68 + size_t settings_size = 0;
69 uint8_t* settings_data = av_packet_get_side_data(
70 packet.get(), AV_PKT_DATA_WEBVTT_SETTINGS, &settings_size);
72 @@ -424,7 +424,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
73 buffer = DecoderBuffer::CopyFrom(packet->data, packet->size,
74 side_data.data(), side_data.size());
75 } else {
76 - int side_data_size = 0;
77 + size_t side_data_size = 0;
78 uint8_t* side_data = av_packet_get_side_data(
79 packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size);
81 @@ -485,7 +485,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
82 packet->size - data_offset);
85 - int skip_samples_size = 0;
86 + size_t skip_samples_size = 0;
87 const uint32_t* skip_samples_ptr =
88 reinterpret_cast<const uint32_t*>(av_packet_get_side_data(
89 packet.get(), AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size));
90 diff --git a/chromium/media/filters/ffmpeg_glue.cc b/chromium/media/filters/ffmpeg_glue.cc
91 index 0ef3521473d..8483ecc348f 100644
92 --- a/chromium/media/filters/ffmpeg_glue.cc
93 +++ b/chromium/media/filters/ffmpeg_glue.cc
94 @@ -59,7 +59,6 @@ static int64_t AVIOSeekOperation(void* opaque, int64_t offset, int whence) {
97 void FFmpegGlue::InitializeFFmpeg() {
98 - av_register_all();
101 static void LogContainer(bool is_local_file,
102 @@ -95,9 +94,6 @@ FFmpegGlue::FFmpegGlue(FFmpegURLProtocol* protocol) {
103 // Enable fast, but inaccurate seeks for MP3.
104 format_context_->flags |= AVFMT_FLAG_FAST_SEEK;
106 - // Ensures we can read out various metadata bits like vp8 alpha.
107 - format_context_->flags |= AVFMT_FLAG_KEEP_SIDE_DATA;
109 // Ensures format parsing errors will bail out. From an audit on 11/2017, all
110 // instances were real failures. Solves bugs like http://crbug.com/710791.
111 format_context_->error_recognition |= AV_EF_EXPLODE;
112 diff --git a/chromium/media/filters/ffmpeg_video_decoder.cc b/chromium/media/filters/ffmpeg_video_decoder.cc
113 index ef12477ee89..7996606f5f9 100644
114 --- a/chromium/media/filters/ffmpeg_video_decoder.cc
115 +++ b/chromium/media/filters/ffmpeg_video_decoder.cc
116 @@ -391,7 +391,7 @@ bool FFmpegVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config,
117 if (decode_nalus_)
118 codec_context_->flags2 |= AV_CODEC_FLAG2_CHUNKS;
120 - AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
121 + const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
122 if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) {
123 ReleaseFFmpegResources();
124 return false;
125 diff --git a/chromium/media/filters/media_file_checker.cc b/chromium/media/filters/media_file_checker.cc
126 index 59c2a2fc618..1a9872c7acb 100644
127 --- a/chromium/media/filters/media_file_checker.cc
128 +++ b/chromium/media/filters/media_file_checker.cc
129 @@ -68,7 +68,7 @@ bool MediaFileChecker::Start(base::TimeDelta check_time) {
130 auto context = AVStreamToAVCodecContext(format_context->streams[i]);
131 if (!context)
132 continue;
133 - AVCodec* codec = avcodec_find_decoder(cp->codec_id);
134 + const AVCodec* codec = avcodec_find_decoder(cp->codec_id);
135 if (codec && avcodec_open2(context.get(), codec, nullptr) >= 0) {
136 auto loop = std::make_unique<FFmpegDecodingLoop>(context.get());
137 stream_contexts[i] = {std::move(context), std::move(loop)};
138 diff --git a/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc b/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc
139 index 9002b874611..d12fade8b63 100644
140 --- a/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc
141 +++ b/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc
142 @@ -203,7 +203,7 @@ int32_t H264DecoderImpl::InitDecode(const VideoCodec* codec_settings,
143 // a pointer |this|.
144 av_context_->opaque = this;
146 - AVCodec* codec = avcodec_find_decoder(av_context_->codec_id);
147 + const AVCodec* codec = avcodec_find_decoder(av_context_->codec_id);
148 if (!codec) {
149 // This is an indication that FFmpeg has not been initialized or it has not
150 // been compiled/initialized with the correct set of codecs.