fix: add missing num_threads param to decode_avif disabled stub - #1671
Conversation
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 <noreply@anthropic.com> Signed-off-by: Andre Lustosa <alustosa@redhat.com>
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/meta-pytorch/torchcodec/1671
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 16 PendingAs of commit d7ddd10 with merge base be6d503 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
Hi @andre-motta! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Fixes #1670
Summary
The
#if !TORCHCODEC_ENABLE_AVIFstub fordecode_avifinDecodeAvif.cppis missing thenum_threadsparameter that the header (DecodeAvif.h) declares and the enabled implementation uses. This causeslibtorchcodec_image.soto have an undefined symbol when built withTORCHCODEC_BUILD_AVIF=0, which makesimport torchcodecfail at runtime.The fix adds the missing
[[maybe_unused]] int64_t num_threadsparameter to the disabled stub so its signature matches the header declaration.Test plan
TORCHCODEC_BUILD_AVIF=0and verifyimport torchcodecsucceedsdecode_avif()raises the expected "not compiled with libavif support" error instead of a symbol resolution crash