fix: preserve full-track duration after seek-beyond-buffer reinit
This commit is contained in:
@@ -140,9 +140,11 @@ export class AudioPlayer {
|
|||||||
this.scheduler.addBuffer(result.buffer);
|
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();
|
const estimatedDuration = this.streamDecoder.getEstimatedDuration();
|
||||||
if (estimatedDuration) {
|
if (estimatedDuration && this.duration === 0) {
|
||||||
this.duration = estimatedDuration;
|
this.duration = estimatedDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user