Detect broken Firefox H.264 decoder

The Firefox H.264 decoder on Windows might simply just refuse to deliver
any finished frames. It also doesn't deliver any errors.

Detect this early by expecting a frame after flush() has completed.
This commit is contained in:
Pierre Ossman 2024-11-21 13:16:56 +01:00
parent a89dfd6141
commit 2463ccd08f
1 changed files with 9 additions and 1 deletions

View File

@ -113,10 +113,11 @@ async function _checkWebCodecsH264DecodeSupport() {
'NjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCBpcF9yYXRpbz0xLjQwIGFx' +
'PTE6MS4wMACAAAABZYiEBrxmKAAPVccAAS044AA5DRJMnkycJk4TPw=='));
let gotframe = false;
let error = null;
let decoder = new VideoDecoder({
output: (frame) => {},
output: (frame) => { gotframe = true; },
error: (e) => { error = e; },
});
let chunk = new EncodedVideoChunk({
@ -135,6 +136,13 @@ async function _checkWebCodecsH264DecodeSupport() {
error = e;
}
// Firefox fails to deliver the error on Windows, so we need to
// check if we got a frame instead
// https://bugzilla.mozilla.org/show_bug.cgi?id=1932579
if (!gotframe) {
return false;
}
if (error !== null) {
return false;
}