fix audio codec
This commit is contained in:
parent
31e81432e3
commit
16f267052d
@ -892,6 +892,7 @@ class MenuTrack:
|
|||||||
|
|
||||||
|
|
||||||
class Tracks:
|
class Tracks:
|
||||||
|
AUDIO_CODEC_MAP = {"EC3": "ec-3", "AAC": "mp4a"}
|
||||||
"""
|
"""
|
||||||
Tracks.
|
Tracks.
|
||||||
Stores video, audio, and subtitle tracks. It also stores chapter/menu entries.
|
Stores video, audio, and subtitle tracks. It also stores chapter/menu entries.
|
||||||
@ -1190,7 +1191,7 @@ class Tracks:
|
|||||||
if not with_descriptive:
|
if not with_descriptive:
|
||||||
self.audios = [x for x in self.audios if not x.descriptive]
|
self.audios = [x for x in self.audios if not x.descriptive]
|
||||||
if by_codec:
|
if by_codec:
|
||||||
codec_audio = list(filter(lambda x: any(y for y in self.AUDIO_CODEC_MAP[by_codec] if y in x.codec), self.audio))
|
codec_audio = list(filter(lambda x: any(y for y in self.AUDIO_CODEC_MAP[by_codec] if y in x.codec), self.audios))
|
||||||
if not codec_audio and not should_fallback:
|
if not codec_audio and not should_fallback:
|
||||||
raise ValueError(f"There's no {by_codec} audio tracks. Aborting.")
|
raise ValueError(f"There's no {by_codec} audio tracks. Aborting.")
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user