public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Than Ngo <than@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/chromium] epel9-next: Fixed FTBFS due to old ffmpeg-5.x on EL9
Date: Fri, 07 Aug 2026 16:08:20 GMT	[thread overview]
Message-ID: <178611890079.1.16294663164017188946.rpms-chromium-7b1d533db730@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/chromium
Branch : epel9-next
Commit : 7b1d533db7307255eed6a26da869fa3780646278
Author : Than Ngo <than@redhat.com>
Date   : 2025-11-03T09:15:55+01:00
Stats  : +174/-138 in 4 file(s)
URL    : https://src.fedoraproject.org/rpms/chromium/c/7b1d533db7307255eed6a26da869fa3780646278?branch=epel9-next

Log:
Fixed FTBFS due to old ffmpeg-5.x on EL9

---
diff --git a/chromium-139-el9-ffmpeg-5.1.x.patch b/chromium-139-el9-ffmpeg-5.1.x.patch
deleted file mode 100644
index 992197c..0000000
--- a/chromium-139-el9-ffmpeg-5.1.x.patch
+++ /dev/null
@@ -1,138 +0,0 @@
-diff -up chromium-139.0.7258.5/media/ffmpeg/ffmpeg_common.cc.el9-ffmpeg-5.1.x chromium-139.0.7258.5/media/ffmpeg/ffmpeg_common.cc
---- chromium-139.0.7258.5/media/ffmpeg/ffmpeg_common.cc.el9-ffmpeg-5.1.x	2025-07-06 20:30:36.125746197 +0200
-+++ chromium-139.0.7258.5/media/ffmpeg/ffmpeg_common.cc	2025-07-06 20:36:47.648896691 +0200
-@@ -784,8 +784,13 @@ bool AVStreamToVideoDecoderConfig(const
-   }
- 
-   VideoTransformation video_transformation = VideoTransformation();
-+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 102)
-+  for (int i = 0; i < stream->nb_side_data; i++) {
-+    const auto& side_data = stream->side_data[i];
-+#else
-   for (const auto& side_data :
-        AVCodecParametersCodedSideToSpan(stream->codecpar)) {
-+#endif
-     switch (side_data.type) {
-       case AV_PKT_DATA_DISPLAYMATRIX: {
-         CHECK_EQ(side_data.size, sizeof(int32_t) * 3 * 3);
-diff -up chromium-139.0.7258.5/media/ffmpeg/ffmpeg_common.h.el9-ffmpeg-5.1.x chromium-139.0.7258.5/media/ffmpeg/ffmpeg_common.h
---- chromium-139.0.7258.5/media/ffmpeg/ffmpeg_common.h.el9-ffmpeg-5.1.x	2025-06-25 00:02:26.000000000 +0200
-+++ chromium-139.0.7258.5/media/ffmpeg/ffmpeg_common.h	2025-07-06 20:30:36.131085710 +0200
-@@ -93,6 +93,7 @@ inline base::span<const uint8_t> AVPacke
-       base::span(packet.data, base::checked_cast<size_t>(packet.size)));
- }
- 
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(60, 31, 102)
- inline base::span<AVStream*> AVFormatContextToSpan(
-     const AVFormatContext* codec_context) {
-   // SAFETY:
-@@ -114,6 +115,7 @@ inline base::span<AVPacketSideData> AVCo
-       base::span(codecpar->coded_side_data,
-                  base::checked_cast<size_t>(codecpar->nb_coded_side_data)));
- }
-+#endif
- 
- // Converts an int64_t timestamp in |time_base| units to a base::TimeDelta.
- // For example if |timestamp| equals 11025 and |time_base| equals {1, 44100}
-diff -up chromium-139.0.7258.5/media/filters/audio_video_metadata_extractor.cc.el9-ffmpeg-5.1.x chromium-139.0.7258.5/media/filters/audio_video_metadata_extractor.cc
---- chromium-139.0.7258.5/media/filters/audio_video_metadata_extractor.cc.el9-ffmpeg-5.1.x	2025-06-25 00:02:26.000000000 +0200
-+++ chromium-139.0.7258.5/media/filters/audio_video_metadata_extractor.cc	2025-07-06 20:30:36.131372795 +0200
-@@ -109,17 +109,33 @@ bool AudioVideoMetadataExtractor::Extrac
-   container_info.type = format_context->iformat->name;
-   ExtractDictionary(format_context->metadata, &container_info.tags);
- 
-+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 102)
-+  for (unsigned int i = 0; i < format_context->nb_streams; ++i) {
-+    stream_infos_.push_back(StreamInfo());
-+#else
-   base::span<AVStream*> format_context_span =
-       AVFormatContextToSpan(format_context);
-   std::ranges::for_each(format_context_span, [&](AVStream* stream) {
-     stream_infos_.emplace_back();
-+#endif
-     StreamInfo& info = stream_infos_.back();
- 
-+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 102)
-+    AVStream* stream = format_context->streams[i];
-+    if (!stream)
-+      continue;
-+#else
-     if (!stream) {
-       return;
-     }
-+#endif
- 
-+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 102)
-+    for (int j = 0; j < stream->nb_side_data; j++) {
-+      const AVPacketSideData& sd = stream->side_data[j];
-+#else
-     for (const auto& sd : AVCodecParametersCodedSideToSpan(stream->codecpar)) {
-+#endif
-       if (sd.type == AV_PKT_DATA_DISPLAYMATRIX) {
-         CHECK_EQ(sd.size, sizeof(int32_t) * 3 * 3);
-         rotation_ = VideoTransformation::FromFFmpegDisplayMatrix(
-@@ -135,7 +151,11 @@ bool AudioVideoMetadataExtractor::Extrac
-     ExtractDictionary(stream->metadata, &info.tags);
- 
-     if (!stream->codecpar) {
-+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 102)
-+      continue;
-+#else
-       return;
-+#endif
-     }
- 
-     info.type = avcodec_get_name(stream->codecpar->codec_id);
-@@ -158,7 +178,11 @@ bool AudioVideoMetadataExtractor::Extrac
-           reinterpret_cast<const char*>(stream->attached_pic.data),
-           stream->attached_pic.size);
-     }
-+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 102)
-+  }
-+#else
-   });
-+#endif
- 
-   extracted_ = true;
-   return true;
-diff -up chromium-139.0.7258.5/media/filters/media_file_checker.cc.el9-ffmpeg-5.1.x chromium-139.0.7258.5/media/filters/media_file_checker.cc
---- chromium-139.0.7258.5/media/filters/media_file_checker.cc.el9-ffmpeg-5.1.x	2025-06-25 00:02:26.000000000 +0200
-+++ chromium-139.0.7258.5/media/filters/media_file_checker.cc	2025-07-06 20:30:36.131615487 +0200
-@@ -64,6 +64,10 @@ bool MediaFileChecker::Start(base::TimeD
-   // Remember the codec context for any decodable audio or video streams.
-   bool found_streams = false;
-   std::vector<Decoder> stream_contexts(format_context->nb_streams);
-+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 102)
-+  for (size_t i = 0; i < format_context->nb_streams; ++i) {
-+    AVCodecParameters* cp = format_context->streams[i]->codecpar;
-+#else
-   base::span<AVStream*> format_context_span =
-       AVFormatContextToSpan(format_context);
-   std::ranges::transform(
-@@ -85,9 +89,26 @@ bool MediaFileChecker::Start(base::TimeD
-           }
-         }
- 
-+#endif
-+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 102)
-+    if (cp->codec_type == AVMEDIA_TYPE_AUDIO ||
-+        cp->codec_type == AVMEDIA_TYPE_VIDEO) {
-+      auto context = AVStreamToAVCodecContext(format_context->streams[i]);
-+      if (!context)
-+        continue;
-+      const AVCodec* codec = avcodec_find_decoder(cp->codec_id);
-+      if (codec && avcodec_open2(context.get(), codec, nullptr) >= 0) {
-+        auto loop = std::make_unique<FFmpegDecodingLoop>(context.get());
-+        stream_contexts[i] = {std::move(context), std::move(loop)};
-+        found_streams = true;
-+      }
-+    }
-+  }
-+#else
-         return Decoder{};
-       });
- 
-+#endif
-   if (!found_streams)
-     return false;
- 

diff --git a/chromium-142-el9-ffmpeg-5.1.x.patch b/chromium-142-el9-ffmpeg-5.1.x.patch
new file mode 100644
index 0000000..fe526f7
--- /dev/null
+++ b/chromium-142-el9-ffmpeg-5.1.x.patch
@@ -0,0 +1,136 @@
+diff -up chromium-142.0.7444.59/media/ffmpeg/ffmpeg_common.cc.el9-ffmpeg-5.1.x chromium-142.0.7444.59/media/ffmpeg/ffmpeg_common.cc
+--- chromium-142.0.7444.59/media/ffmpeg/ffmpeg_common.cc.el9-ffmpeg-5.1.x	2025-11-01 22:14:10.116779876 +0100
++++ chromium-142.0.7444.59/media/ffmpeg/ffmpeg_common.cc	2025-11-01 22:14:10.134140132 +0100
+@@ -800,8 +803,13 @@ bool AVStreamToVideoDecoderConfig(const
+   }
+ 
+   VideoTransformation video_transformation = VideoTransformation();
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 102)
++  for (int i = 0; i < stream->nb_side_data; i++) {
++    const auto& side_data = stream->side_data[i];
++#else
+   for (const auto& side_data :
+        AVCodecParametersCodedSideToSpan(stream->codecpar)) {
++#endif
+     switch (side_data.type) {
+       case AV_PKT_DATA_DISPLAYMATRIX: {
+         CHECK_EQ(side_data.size, sizeof(int32_t) * 3 * 3);
+diff -up chromium-142.0.7444.59/media/ffmpeg/ffmpeg_common.h.el9-ffmpeg-5.1.x chromium-142.0.7444.59/media/ffmpeg/ffmpeg_common.h
+--- chromium-142.0.7444.59/media/ffmpeg/ffmpeg_common.h.el9-ffmpeg-5.1.x	2025-10-24 18:42:30.000000000 +0200
++++ chromium-142.0.7444.59/media/ffmpeg/ffmpeg_common.h	2025-11-02 08:06:48.997329630 +0100
+@@ -111,9 +111,13 @@ inline base::span<AVPacketSideData> AVCo
+   // https://ffmpeg.org/doxygen/trunk/structAVCodecParameters.html#a29643cfd94231e2d148a5d17b08d115b
+   // ffmpeg documentation: `nb_coded_side_data` is the amount of entries in
+   // `coded_side_data`.
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(60, 31, 102)
+   return UNSAFE_BUFFERS(
+       base::span(codecpar->coded_side_data,
+                  base::checked_cast<size_t>(codecpar->nb_coded_side_data)));
++#else
++   return base::span<AVPacketSideData>();
++#endif
+ }
+ 
+ // Converts an int64_t timestamp in |time_base| units to a base::TimeDelta.
+diff -up chromium-142.0.7444.59/media/filters/audio_video_metadata_extractor.cc.el9-ffmpeg-5.1.x chromium-142.0.7444.59/media/filters/audio_video_metadata_extractor.cc
+--- chromium-142.0.7444.59/media/filters/audio_video_metadata_extractor.cc.el9-ffmpeg-5.1.x	2025-10-24 18:42:30.000000000 +0200
++++ chromium-142.0.7444.59/media/filters/audio_video_metadata_extractor.cc	2025-11-01 22:14:10.124748634 +0100
+@@ -109,17 +109,33 @@ bool AudioVideoMetadataExtractor::Extrac
+   container_info.type = format_context->iformat->name;
+   ExtractDictionary(format_context->metadata, &container_info.tags);
+ 
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 102)
++  for (unsigned int i = 0; i < format_context->nb_streams; ++i) {
++    stream_infos_.push_back(StreamInfo());
++#else
+   base::span<AVStream*> format_context_span =
+       AVFormatContextToSpan(format_context);
+   std::ranges::for_each(format_context_span, [&](AVStream* stream) {
+     stream_infos_.emplace_back();
++#endif
+     StreamInfo& info = stream_infos_.back();
+ 
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 102)
++    AVStream* stream = format_context->streams[i];
++    if (!stream)
++      continue;
++#else
+     if (!stream) {
+       return;
+     }
++#endif
+ 
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 102)
++    for (int j = 0; j < stream->nb_side_data; j++) {
++      const AVPacketSideData& sd = stream->side_data[j];
++#else
+     for (const auto& sd : AVCodecParametersCodedSideToSpan(stream->codecpar)) {
++#endif
+       if (sd.type == AV_PKT_DATA_DISPLAYMATRIX) {
+         CHECK_EQ(sd.size, sizeof(int32_t) * 3 * 3);
+         rotation_ = VideoTransformation::FromFFmpegDisplayMatrix(
+@@ -135,7 +151,11 @@ bool AudioVideoMetadataExtractor::Extrac
+     ExtractDictionary(stream->metadata, &info.tags);
+ 
+     if (!stream->codecpar) {
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 102)
++      continue;
++#else
+       return;
++#endif
+     }
+ 
+     info.type = avcodec_get_name(stream->codecpar->codec_id);
+@@ -158,7 +178,11 @@ bool AudioVideoMetadataExtractor::Extrac
+           reinterpret_cast<const char*>(stream->attached_pic.data),
+           stream->attached_pic.size);
+     }
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 102)
++  }
++#else
+   });
++#endif
+ 
+   extracted_ = true;
+   return true;
+diff -up chromium-142.0.7444.59/media/filters/media_file_checker.cc.el9-ffmpeg-5.1.x chromium-142.0.7444.59/media/filters/media_file_checker.cc
+--- chromium-142.0.7444.59/media/filters/media_file_checker.cc.el9-ffmpeg-5.1.x	2025-10-24 18:42:30.000000000 +0200
++++ chromium-142.0.7444.59/media/filters/media_file_checker.cc	2025-11-01 22:14:10.125099595 +0100
+@@ -64,6 +64,10 @@ bool MediaFileChecker::Start(base::TimeD
+   // Remember the codec context for any decodable audio or video streams.
+   bool found_streams = false;
+   std::vector<Decoder> stream_contexts(format_context->nb_streams);
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 102)
++  for (size_t i = 0; i < format_context->nb_streams; ++i) {
++    AVCodecParameters* cp = format_context->streams[i]->codecpar;
++#else
+   base::span<AVStream*> format_context_span =
+       AVFormatContextToSpan(format_context);
+   std::ranges::transform(
+@@ -85,9 +89,26 @@ bool MediaFileChecker::Start(base::TimeD
+           }
+         }
+ 
++#endif
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(60, 31, 102)
++    if (cp->codec_type == AVMEDIA_TYPE_AUDIO ||
++        cp->codec_type == AVMEDIA_TYPE_VIDEO) {
++      auto context = AVStreamToAVCodecContext(format_context->streams[i]);
++      if (!context)
++        continue;
++      const AVCodec* codec = avcodec_find_decoder(cp->codec_id);
++      if (codec && avcodec_open2(context.get(), codec, nullptr) >= 0) {
++        auto loop = std::make_unique<FFmpegDecodingLoop>(context.get());
++        stream_contexts[i] = {std::move(context), std::move(loop)};
++        found_streams = true;
++      }
++    }
++  }
++#else
+         return Decoder{};
+       });
+ 
++#endif
+   if (!found_streams)
+     return false;
+ 

diff --git a/chromium-142-el9-ffmpeg-5.x-duration.patch b/chromium-142-el9-ffmpeg-5.x-duration.patch
new file mode 100644
index 0000000..8b42cb2
--- /dev/null
+++ b/chromium-142-el9-ffmpeg-5.x-duration.patch
@@ -0,0 +1,18 @@
+Fix FTBFS on EL9 due to old ffmpeg-5.x
+
+diff -up chromium-142.0.7444.59/media/filters/legacy_audio_file_reader.cc.me chromium-142.0.7444.59/media/filters/legacy_audio_file_reader.cc
+--- chromium-142.0.7444.59/media/filters/legacy_audio_file_reader.cc.me	2025-11-02 08:20:16.949092776 +0100
++++ chromium-142.0.7444.59/media/filters/legacy_audio_file_reader.cc	2025-11-02 08:22:01.331132435 +0100
+@@ -273,10 +273,10 @@ bool LegacyAudioFileReader::OnNewFrame(
+   // silence from being output. In the case where we are also discarding some
+   // portion of the packet (as indicated by a negative pts), we further want to
+   // adjust the duration downward by however much exists before zero.
+-  if (audio_codec_ == AudioCodec::kAAC && frame->duration) {
++  if (audio_codec_ == AudioCodec::kAAC && frame->pkt_duration) {
+     const base::TimeDelta pkt_duration = ConvertFromTimeBase(
+         UNSAFE_TODO(glue_->format_context()->streams[stream_index_])->time_base,
+-        frame->duration + std::min(static_cast<int64_t>(0), frame->pts));
++        frame->pkt_duration + std::min(static_cast<int64_t>(0), frame->pts));
+     const base::TimeDelta frame_duration =
+         base::Seconds(frames_read / static_cast<double>(sample_rate_));
+ 

diff --git a/chromium-142-el9-rust_alloc_error_handler_should_panic.patch b/chromium-142-el9-rust_alloc_error_handler_should_panic.patch
new file mode 100644
index 0000000..5b07869
--- /dev/null
+++ b/chromium-142-el9-rust_alloc_error_handler_should_panic.patch
@@ -0,0 +1,20 @@
+Fix FTBFS due to old rust compiler on EL9
+
+error: undefined symbol: __rust_alloc_error_handler_should_panic
+
+
+diff -up chromium-142.0.7444.52/build/rust/allocator/lib.rs.me chromium-142.0.7444.52/build/rust/allocator/lib.rs
+--- chromium-142.0.7444.52/build/rust/allocator/lib.rs.me	2025-10-31 12:29:40.849457901 +0100
++++ chromium-142.0.7444.52/build/rust/allocator/lib.rs	2025-10-31 12:30:37.753590615 +0100
+@@ -101,6 +101,11 @@ mod both_allocators {
+     #[linkage = "weak"]
+     static __rust_no_alloc_shim_is_unstable: u8 = 0;
+ 
++    // Mangle the symbol name as rustc (1.84) expects on EL9
++    #[no_mangle]
++    #[linkage = "weak"]
++    static __rust_alloc_error_handler_should_panic: u8 = 0;
++
+     // Mangle the symbol name as rustc expects.
+     #[rustc_std_internal_symbol]
+     #[allow(non_upper_case_globals)]

                 reply	other threads:[~2026-08-07 16:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178611890079.1.16294663164017188946.rpms-chromium-7b1d533db730@fedoraproject.org \
    --to=than@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox