Skip to content

Commit

Permalink
Handle exceptions from VideoDecoder.flush()
Browse files Browse the repository at this point in the history
These are not supposed to happen according to the specification, but
Firefox has some bug and throws them anyway.
  • Loading branch information
CendioOssman committed Nov 21, 2024
1 parent 3677afe commit a89dfd6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/util/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a89dfd6

Please sign in to comment.