File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -88,20 +88,19 @@ def load_torchcodec_shared_libraries() -> tuple[int, str]:
8888 )
8989
9090
91+ expose_ffmpeg_dlls = nullcontext
9192if sys .platform == "win32" and hasattr (os , "add_dll_directory" ):
9293 # On windows we try to locate the FFmpeg DLLs and temporarily add them to
9394 # the DLL search path. This seems to be needed on some users machine, but
9495 # not on our CI. We don't know why.
9596 if ffmpeg_path := shutil .which ("ffmpeg" ):
9697
97- def cm (): # noqa: F811
98+ def expose_ffmpeg_dlls (): # noqa: F811
9899 ffmpeg_dir = Path (ffmpeg_path ).parent
99100 return os .add_dll_directory (str (ffmpeg_dir )) # that's the actual CM
100101
101- else :
102- cm = nullcontext
103102
104- with cm ():
103+ with expose_ffmpeg_dlls ():
105104 ffmpeg_major_version , core_library_path = load_torchcodec_shared_libraries ()
106105
107106
You can’t perform that action at this time.
0 commit comments