This commit is contained in:
@@ -60,7 +60,8 @@ def get_preferred_audio_stream_index(path: Path) -> int | None:
|
||||
"ffprobe",
|
||||
"-v", "quiet",
|
||||
"-print_format", "json",
|
||||
"-show_entries", "stream=index,codec_type:stream_tags=language",
|
||||
"-select_streams", "a",
|
||||
"-show_entries", "stream=index:stream_tags=language",
|
||||
str(path),
|
||||
],
|
||||
capture_output=True,
|
||||
@@ -88,11 +89,15 @@ def get_preferred_audio_stream_index(path: Path) -> int | None:
|
||||
flemish = ("vls", "nl-be", "nlb")
|
||||
for idx, lang, raw in audio_streams:
|
||||
if lang in dutch or raw in dutch:
|
||||
logger.debug("Audio: selected stream %s (lang=%s)", idx, raw or "(none)")
|
||||
return idx
|
||||
for idx, lang, raw in audio_streams:
|
||||
if lang in flemish or raw in flemish:
|
||||
logger.debug("Audio: selected stream %s (Flemish, lang=%s)", idx, raw or "(none)")
|
||||
return idx
|
||||
return audio_streams[0][0]
|
||||
idx = audio_streams[0][0]
|
||||
logger.debug("Audio: no Dutch/Flemish found, using first stream %s (lang=%s)", idx, audio_streams[0][2] or "(none)")
|
||||
return idx
|
||||
except (
|
||||
subprocess.TimeoutExpired,
|
||||
ValueError,
|
||||
|
||||
Reference in New Issue
Block a user