diff --git a/src/torchcodec/_core/ops.py b/src/torchcodec/_core/ops.py index 20f3ff14..4e4f7320 100644 --- a/src/torchcodec/_core/ops.py +++ b/src/torchcodec/_core/ops.py @@ -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: # diff --git a/src/torchcodec/_internally_replaced_utils.py b/src/torchcodec/_internally_replaced_utils.py index d49e0346..c5e9511a 100644 --- a/src/torchcodec/_internally_replaced_utils.py +++ b/src/torchcodec/_internally_replaced_utils.py @@ -53,7 +53,7 @@ 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: +def _get_pybind_ops_module_name(ffmpeg_major_version: int) -> 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