[utils] Restrict parse_codecs and add theora as known vcodec (#21381)

This commit is contained in:
Sergey M․ 2019-06-14 01:56:17 +07:00
parent 8361e7f934
commit 28cc2241e4
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D
2 changed files with 12 additions and 8 deletions

View file

@ -822,6 +822,15 @@ class TestUtil(unittest.TestCase):
'vcodec': 'av01.0.05M.08',
'acodec': 'none',
})
self.assertEqual(parse_codecs('theora, vorbis'), {
'vcodec': 'theora',
'acodec': 'vorbis',
})
self.assertEqual(parse_codecs('unknownvcodec, unknownacodec'), {
'vcodec': 'unknownvcodec',
'acodec': 'unknownacodec',
})
self.assertEqual(parse_codecs('unknown'), {})
def test_escape_rfc3986(self):
reserved = "!*'();:@&=+$,/?#[]"