From d9d8b67b48a44a31b3de6f336dbe85762c1b75fc Mon Sep 17 00:00:00 2001 From: McCloudS <64094529+McCloudS@users.noreply.github.com> Date: Sun, 8 Sep 2024 07:16:00 -0600 Subject: [PATCH] Fixed codec check again --- subgen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subgen.py b/subgen.py index fdf9748..c2e3e9c 100644 --- a/subgen.py +++ b/subgen.py @@ -819,7 +819,7 @@ def has_audio(file_path): for stream in container.streams: if stream.type == 'audio': # Check if the stream has a codec and if it is valid - if stream.codec and stream.codec.name != 'none': + if stream.codec_context and stream.codec_context.name != 'none': return True else: logging.debug(f"Unsupported or missing codec for audio stream in {file_path}")