From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: "Sven Püschel" <s.pueschel@pengutronix.de>
Subject: Re: [ptxdist] [APPLIED] ffmpeg: fix missing symbol in libswscale.so.10
Date: Tue, 17 Nov 2026 07:14:32 +0100 [thread overview]
Message-ID: <20261117061432.3091034-1-m.olbrich@pengutronix.de> (raw)
In-Reply-To: <20261104093811.2019171-1-s.pueschel@pengutronix.de>
Thanks, applied as e39019ce25dc7e62133b08f2c5aa75039ad8556d.
Michael
[sent from post-receive hook]
On Tue, 17 Nov 2026 07:14:32 +0100, Sven Püschel <s.pueschel@pengutronix.de> wrote:
> 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 <s.pueschel@pengutronix.de>
> Message-Id: <20261104093811.2019171-1-s.pueschel@pengutronix.de>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
>
> 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 000000000000..7c2daca407ae
> --- /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 <andreas.rheinhardt@outlook.com>
> +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 <andreas.rheinhardt@outlook.com>
> +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 000000000000..ff268ecd1362
> --- /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
prev parent reply other threads:[~2026-11-17 6:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 9:37 [ptxdist] [PATCH] " Sven Püschel
2026-11-17 6:14 ` Michael Olbrich [this message]
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=20261117061432.3091034-1-m.olbrich@pengutronix.de \
--to=m.olbrich@pengutronix.de \
--cc=ptxdist@pengutronix.de \
--cc=s.pueschel@pengutronix.de \
/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