From d7ddd1061626692760ed5c9ae93aec599d93a3e8 Mon Sep 17 00:00:00 2001 From: Andre Lustosa Date: Mon, 24 Aug 2026 10:09:21 -0400 Subject: [PATCH] fix: add missing num_threads param to decode_avif disabled stub The disabled-AVIF stub for decode_avif declares 3 parameters (input, mode, output_dtype) but the header in DecodeAvif.h declares 4 (adding num_threads). When building with TORCHCODEC_BUILD_AVIF=0, the linker leaves the 4-parameter symbol unresolved, causing an OSError at runtime when libtorchcodec_image.so is loaded. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Andre Lustosa --- src/torchcodec/_core/DecodeAvif.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/torchcodec/_core/DecodeAvif.cpp b/src/torchcodec/_core/DecodeAvif.cpp index 17fd03a28..b40b9b97c 100644 --- a/src/torchcodec/_core/DecodeAvif.cpp +++ b/src/torchcodec/_core/DecodeAvif.cpp @@ -19,7 +19,8 @@ namespace facebook::torchcodec { torch::stable::Tensor decode_avif( [[maybe_unused]] const torch::stable::Tensor& input, [[maybe_unused]] int64_t mode, - [[maybe_unused]] int64_t output_dtype) { + [[maybe_unused]] int64_t output_dtype, + [[maybe_unused]] int64_t num_threads) { STD_TORCH_CHECK( false, "decode_avif: torchcodec was not compiled with libavif support. Rebuild "