From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Wed, 04 Nov 2026 10:38:29 +0100 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1xOXRt-007AKF-1C for lore@lore.pengutronix.de; Wed, 04 Nov 2026 10:38:29 +0100 Received: from [127.0.0.1] (helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1xOXRs-00006g-Tm; Wed, 04 Nov 2026 10:38:28 +0100 Received: from dude04.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::ac]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1xOXRc-00006O-De; Wed, 04 Nov 2026 10:38:12 +0100 From: =?UTF-8?q?Sven=20P=C3=BCschel?= To: ptxdist@pengutronix.de Date: Wed, 4 Nov 2026 10:37:40 +0100 Message-ID: <20261104093811.2019171-1-s.pueschel@pengutronix.de> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [ptxdist] [PATCH] ffmpeg: fix missing symbol in libswscale.so.10 X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: =?UTF-8?q?Sven=20P=C3=BCschel?= Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false Backport a patch to fix the missing symbol in libswscale.so.10 . Without it the libswscale.so.10 file cannot be used at runtime due to a missing ff_sws_chroma_pos symbol. This is cased by the implementation of this function being guarded behind a CONFIG_UNSTABLE macro guard, but the definition and usage don't use this guard. Therefore the implementation is missing when building without CONFIG_UNSTABLE resulting in the library not being able to be loaded. Fixes: 0624017a6b57 ("ffmpeg: version bump 8.0 -> 9.0.2") Signed-off-by: Sven Püschel --- ...uild-ff_sws_chroma_pos-even-without-.patch | 113 ++++++++++++++++++ patches/ffmpeg-9.0.2/series | 4 + 2 files changed, 117 insertions(+) create mode 100644 patches/ffmpeg-9.0.2/0001-swscale-format-Build-ff_sws_chroma_pos-even-without-.patch create mode 100644 patches/ffmpeg-9.0.2/series diff --git a/patches/ffmpeg-9.0.2/0001-swscale-format-Build-ff_sws_chroma_pos-even-without-.patch b/patches/ffmpeg-9.0.2/0001-swscale-format-Build-ff_sws_chroma_pos-even-without-.patch new file mode 100644 index 000000000..7c2daca40 --- /dev/null +++ b/patches/ffmpeg-9.0.2/0001-swscale-format-Build-ff_sws_chroma_pos-even-without-.patch @@ -0,0 +1,113 @@ +From: Andreas Rheinhardt +Date: Tue, 30 Jun 2026 21:44:27 +0200 +Subject: [PATCH] swscale/format: Build ff_sws_chroma_pos() even without + CONFIG_UNSTABLE + +It is used in add_legacy_sws_pass() in graph.c. + +Signed-off-by: Andreas Rheinhardt +Upstream-Status: Backport [fad1db043d45d4d3cc482934ac6cd579f556a6e8] +--- + libswscale/format.c | 82 ++++++++++++++++++++++++++--------------------------- + 1 file changed, 41 insertions(+), 41 deletions(-) + +diff --git a/libswscale/format.c b/libswscale/format.c +index b03cfff44aa7..70cc813dd767 100644 +--- a/libswscale/format.c ++++ b/libswscale/format.c +@@ -551,6 +551,47 @@ bool ff_infer_colors(SwsColor *src, SwsColor *dst) + return incomplete; + } + ++void ff_sws_chroma_pos(const SwsFormat *fmt, bool *incomplete, ++ int *out_x_pos, int *out_y_pos) ++{ ++ enum AVChromaLocation chroma_loc = fmt->loc; ++ const int sub_x = fmt->desc->log2_chroma_w; ++ const int sub_y = fmt->desc->log2_chroma_h; ++ int x_pos, y_pos; ++ ++ /* Explicitly default to center siting for compatibility with swscale */ ++ if (chroma_loc == AVCHROMA_LOC_UNSPECIFIED) { ++ chroma_loc = AVCHROMA_LOC_CENTER; ++ *incomplete |= sub_x || sub_y; ++ } ++ ++ /* av_chroma_location_enum_to_pos() always gives us values in the range from ++ * 0 to 256, but we need to adjust this to the true value range of the ++ * subsampling grid, which may be larger for h/v_sub > 1 */ ++ av_chroma_location_enum_to_pos(&x_pos, &y_pos, chroma_loc); ++ x_pos *= (1 << sub_x) - 1; ++ y_pos *= (1 << sub_y) - 1; ++ ++ /* Fix vertical chroma position for interlaced frames */ ++ if (sub_y && fmt->interlaced) { ++ /* When vertically subsampling, chroma samples are effectively only ++ * placed next to even rows. To access them from the odd field, we need ++ * to account for this shift by offsetting the distance of one luma row. ++ * ++ * For 4x vertical subsampling (v_sub == 2), they are only placed ++ * next to every *other* even row, so we need to shift by three luma ++ * rows to get to the chroma sample. */ ++ if (fmt->field == FIELD_BOTTOM) ++ y_pos += (256 << sub_y) - 256; ++ ++ /* Luma row distance is doubled for fields, so halve offsets */ ++ y_pos >>= 1; ++ } ++ ++ *out_x_pos = x_pos; ++ *out_y_pos = y_pos; ++} ++ + /* Variant of sws_test_format() for the ops-based code */ + static int test_format_ops(enum AVPixelFormat format, int output); + static int test_format_legacy(enum AVPixelFormat format, int output) +@@ -1434,47 +1475,6 @@ linear_mat3(const AVRational m00, const AVRational m01, const AVRational m02, + return c; + } + +-void ff_sws_chroma_pos(const SwsFormat *fmt, bool *incomplete, +- int *out_x_pos, int *out_y_pos) +-{ +- enum AVChromaLocation chroma_loc = fmt->loc; +- const int sub_x = fmt->desc->log2_chroma_w; +- const int sub_y = fmt->desc->log2_chroma_h; +- int x_pos, y_pos; +- +- /* Explicitly default to center siting for compatibility with swscale */ +- if (chroma_loc == AVCHROMA_LOC_UNSPECIFIED) { +- chroma_loc = AVCHROMA_LOC_CENTER; +- *incomplete |= sub_x || sub_y; +- } +- +- /* av_chroma_location_enum_to_pos() always gives us values in the range from +- * 0 to 256, but we need to adjust this to the true value range of the +- * subsampling grid, which may be larger for h/v_sub > 1 */ +- av_chroma_location_enum_to_pos(&x_pos, &y_pos, chroma_loc); +- x_pos *= (1 << sub_x) - 1; +- y_pos *= (1 << sub_y) - 1; +- +- /* Fix vertical chroma position for interlaced frames */ +- if (sub_y && fmt->interlaced) { +- /* When vertically subsampling, chroma samples are effectively only +- * placed next to even rows. To access them from the odd field, we need +- * to account for this shift by offsetting the distance of one luma row. +- * +- * For 4x vertical subsampling (v_sub == 2), they are only placed +- * next to every *other* even row, so we need to shift by three luma +- * rows to get to the chroma sample. */ +- if (fmt->field == FIELD_BOTTOM) +- y_pos += (256 << sub_y) - 256; +- +- /* Luma row distance is doubled for fields, so halve offsets */ +- y_pos >>= 1; +- } +- +- *out_x_pos = x_pos; +- *out_y_pos = y_pos; +-} +- + int ff_sws_decode_colors(SwsContext *ctx, SwsPixelType type, + SwsOpList *ops, const SwsFormat *fmt, bool *incomplete) + { diff --git a/patches/ffmpeg-9.0.2/series b/patches/ffmpeg-9.0.2/series new file mode 100644 index 000000000..ff268ecd1 --- /dev/null +++ b/patches/ffmpeg-9.0.2/series @@ -0,0 +1,4 @@ +# generated by git-ptx-patches +#tag:base --start-number 1 +0001-swscale-format-Build-ff_sws_chroma_pos-even-without-.patch +# 3d2e6d30725921cf2abc010a75daa5a7 - git-ptx-patches magic -- 2.47.3