diff --git a/DeepDrftPublic/Interop/audio/AudioPlayer.ts b/DeepDrftPublic/Interop/audio/AudioPlayer.ts index 22d8c8a..cc0a755 100644 --- a/DeepDrftPublic/Interop/audio/AudioPlayer.ts +++ b/DeepDrftPublic/Interop/audio/AudioPlayer.ts @@ -140,9 +140,11 @@ export class AudioPlayer { this.scheduler.addBuffer(result.buffer); } - // Update duration estimate + // Update duration estimate — set once only; reinitializeFromOffset does not + // reset this.duration, so after a seek-beyond-buffer the synthesised header's + // shorter DataSize cannot overwrite the original full-track duration. const estimatedDuration = this.streamDecoder.getEstimatedDuration(); - if (estimatedDuration) { + if (estimatedDuration && this.duration === 0) { this.duration = estimatedDuration; }