Skip to content

Fix typing error #783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/torchcodec/_core/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@


def load_torchcodec_shared_libraries():
# Successively try to load libtorchcodec_*7.so, libtorchcodec_*6.so,
# libtorchcodec_*5.so, and libtorchcodec_*4.so. Each of these correspond to an
# ffmpeg major version. This should cover all potential ffmpeg versions
# installed on the user's machine.
#
# On fbcode, _get_extension_path() is overridden and directly points to the
# correct .so file, so this for-loop succeeds on the first iteration.
# Successively try to load the shared libraries for each version of FFmpeg
# that we support. We always start with the highest version, working our way
# down to the lowest version. Once we can load ALL shared libraries for a
# version of FFmpeg, we have succeeded and we stop.
#
# Note that we use two different methods for loading shared libraries:
#
Expand Down
16 changes: 8 additions & 8 deletions src/torchcodec/_internally_replaced_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ def _load_pybind11_module(module_name: str, library_path: str) -> ModuleType:
return importlib.util.module_from_spec(spec)


def _get_pybind_ops_module_name(ffmpeg_major_version: str) -> str:
# Note that this value must match the value used as PYBIND_OPS_MODULE_NAME
# when we compile _core/pybind_ops.cpp. If the values do not match, we will
# not be able to import the C++ shared library as a Python module at
# runtime.
#
# The parameter ffmpeg_major_version is unused externally, but used
# internally.
# Note that the return value from this function must match the value used as
# PYBIND_OPS_MODULE_NAME when we compile _core/pybind_ops.cpp. If the values
# do not match, we will not be able to import the C++ shared library as a
# Python module at runtime.
#
# The parameter ffmpeg_major_version is unused externally, but used
# internally.
def _get_pybind_ops_module_name(ffmpeg_major_version: int) -> str:
return "core_pybind_ops"
Loading