Handle exceptions from VideoDecoder.flush()

These are not supposed to happen according to the specification, but
Firefox has some bug and throws them anyway.
This commit is contained in:
Pierre Ossman 2024-11-21 13:16:17 +01:00
parent 3677afe305
commit a89dfd6141
1 changed files with 7 additions and 1 deletions

View File

@ -127,7 +127,13 @@ async function _checkWebCodecsH264DecodeSupport() {
decoder.configure(config);
decoder.decode(chunk);
await decoder.flush();
try {
await decoder.flush();
} catch (e) {
// Firefox incorrectly throws an exception here
// https://bugzilla.mozilla.org/show_bug.cgi?id=1932566
error = e;
}
if (error !== null) {
return false;