Skip to content

Commit

Permalink
Get sample rate immediately to obtain an accurate value (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
devoxin authored Apr 28, 2024
1 parent 588b0ad commit 9a91acd
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,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 9a91acd

Please sign in to comment.