From 9547d363532a9f1ddd6759bfcef8057015abed70 Mon Sep 17 00:00:00 2001 From: Vanilagy <1696106+Vanilagy@users.noreply.github.com> Date: Wed, 1 Jul 2026 13:50:48 +0200 Subject: [PATCH] Add workaround for https://issues.chromium.org/issues/529852980 --- src/conversion.ts | 8 ++++++-- src/media-source.ts | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/conversion.ts b/src/conversion.ts index 8349fde..9b4aab4 100644 --- a/src/conversion.ts +++ b/src/conversion.ts @@ -1329,9 +1329,13 @@ export class Conversion { firstSample.close(); await tempOutput.finalize(); } catch (error) { - Logging._info('Error when probing encoder support. Falling back to rerender path.', error); - needsRerender = true; + Logging._warn( + 'An error occurred when probing encoder support. Falling back to rerender path.', error, + ); void tempOutput.cancel(); + + needsRerender = true; + encodingConfig.transform.force = true; } } else { await tempOutput.cancel(); diff --git a/src/media-source.ts b/src/media-source.ts index 223a7f7..59167d2 100644 --- a/src/media-source.ts +++ b/src/media-source.ts @@ -36,6 +36,7 @@ import { setUint24, toUint8Array, UnthrottledTimerHandle, + wait, } from './misc'; import { Muxer } from './muxer'; import { SubtitleParser } from './subtitles'; @@ -878,6 +879,9 @@ class VideoEncoderWrapper { // These are wired in series, therefore they must also be flushed in series await this.encoder.flush(); await this.alphaEncoder?.flush(); + + // Workaround for https://issues.chromium.org/issues/529852980 to give it time for errors to surface + await wait(25); } if (this.encoder.state !== 'closed') {