Skip to content

Commit

Permalink
Get sample rate immediately to obtain an accurate value (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
devoxin committed Apr 28, 2024
1 parent 64454ab commit 3e90c61
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,13 @@ public OggTrackBlueprint loadBlueprint(OggPacketInputStream stream, DirectBuffer
public OggMetadata loadMetadata(OggPacketInputStream stream, DirectBufferStreamBroker broker) throws IOException {
ByteBuffer firstPacket = broker.getBuffer();
verifyFirstPacket(firstPacket);
int sampleRate = getSampleRate(firstPacket);

loadCommentsHeader(stream, broker, false);

return new OggMetadata(
parseTags(broker.getBuffer(), broker.isTruncated()),
detectLength(stream, getSampleRate(firstPacket))
detectLength(stream, sampleRate)
);
}

Expand Down

0 comments on commit 3e90c61

Please sign in to comment.