Build: Match the codecs output more closely, better semantics

This commit is contained in:
Ross Patterson 2019-08-09 15:09:22 -07:00
parent 145e57bb74
commit ca427cb904

View File

@ -140,7 +140,9 @@ def get_codecs(cmd='ffmpeg'):
codecs = _get_line_fields(stdout, 10, CODEC_RE, CODEC_FLAGS)
for codec in codecs.values():
for coders_match in CODEC_CODERS_RE.finditer(codec['description']):
codec[coders_match.group(1)] = coders_match.group(3).split()
coders = coders_match.group(3).split()
if coders:
codec[coders_match.group(1)] = coders
description_match = CODEC_DESCRIPTION_RE.search(codec['description'])
if description_match is not None:
codec['description'] = description_match.group('description')