mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 02:43:48 +02:00
Return null earlier on
This commit is contained in:
@@ -322,6 +322,10 @@ export class OggDemuxer extends Demuxer {
|
||||
}
|
||||
|
||||
const totalPacketSize = chunks.reduce((sum, chunk) => sum + chunk.length, 0);
|
||||
if (totalPacketSize === 0) {
|
||||
return null; // Invalid packet, treat it as end of stream
|
||||
}
|
||||
|
||||
const packetData = new Uint8Array(totalPacketSize);
|
||||
|
||||
let offset = 0;
|
||||
@@ -499,10 +503,6 @@ class OggAudioTrackBacking implements InputAudioTrackBacking {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (packet.data.byteLength === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { durationInSamples, vorbisBlockSize } = extractSampleMetadata(
|
||||
packet.data,
|
||||
this.bitstream.codecInfo,
|
||||
|
||||
Reference in New Issue
Block a user