Fixed codec check again

This commit is contained in:
McCloudS
2024-09-08 07:16:00 -06:00
committed by GitHub
parent f63db83d62
commit d9d8b67b48

View File

@@ -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}")