Input: Fix audio stream selection for video files. (#150)

`youtube-dl` has a tendency to return mp4 files containing video and audio data vs `yt-dlp`. Naturally, the default stream in such cases will be the video data, so we fail to create a decoder.

This PR changes `LiveInput::promote` to first attempt to instantiate a decoder for the default track. If this fails to do so, then we reattempt this for all available tracks until one can be found. Previously, this method chose the default (or first available) track ID, and then failed if *that* track could not be decoded even if a compatible stream existed.

This was tested using `cargo make ready`, as well as manually verifying and adding a test case with a simple mp4 file.
This commit is contained in:
Kyle Simpson
2022-09-07 01:32:57 +01:00
parent 372156e638
commit 03b0803a1d
4 changed files with 46 additions and 23 deletions

BIN
resources/ting-vid.mp4 Normal file

Binary file not shown.