(bin_name, gui_mode, ffmpeg_resources_path=None)
| 67 | |
| 68 | |
| 69 | def ffmpeg_bin_path(bin_name, gui_mode, ffmpeg_resources_path=None): |
| 70 | if platform.system() == "Windows": |
| 71 | bin_name = "{}.exe".format(bin_name) |
| 72 | if ffmpeg_resources_path is not None: |
| 73 | if not os.path.isdir(ffmpeg_resources_path): |
| 74 | if bin_name.lower().startswith("ffmpeg"): |
| 75 | return ffmpeg_resources_path |
| 76 | ffmpeg_resources_path = os.path.dirname(ffmpeg_resources_path) |
| 77 | return os.path.join(ffmpeg_resources_path, bin_name) |
| 78 | try: |
| 79 | resource_path = os.environ[SUBSYNC_RESOURCES_ENV_MAGIC] |
| 80 | if len(resource_path) > 0: |
| 81 | return os.path.join(resource_path, "ffmpeg-bin", bin_name) |
| 82 | except KeyError: |
| 83 | if gui_mode: |
| 84 | logger.info( |
| 85 | "Couldn't find resource path; falling back to searching system path" |
| 86 | ) |
| 87 | return bin_name |
no outgoing calls
no test coverage detected