Add null check for audio streams
Some checks failed
Python Linting / Run Ruff (push) Has been cancelled
Python Linting / Run Pylint (push) Has been cancelled

This commit is contained in:
Austin Mroz 2026-01-28 23:56:16 -08:00
parent 4b37647ce1
commit 37c2a960cb
No known key found for this signature in database

View File

@ -243,8 +243,8 @@ class VideoFromFile(VideoInput):
audio = None
container.seek(start_pts, stream=video_stream)
# Use last stream for consistency
audio_stream = container.streams.audio[-1]
if audio_stream:
if len(container.streams.audio):
audio_stream = container.streams.audio[-1]
audio_frames = []
resample = av.audio.resampler.AudioResampler(format='fltp').resample
frames = itertools.chain.from_iterable(