Commit 8bafd6ff by olly Committed by Oliver Woodman

Fix FLAC seeking when the last seek point is a placeholder

PiperOrigin-RevId: 285449865
parent b3f485d7
Showing with 3 additions and 2 deletions
...@@ -462,8 +462,9 @@ bool FLACParser::getSeekPositions(int64_t timeUs, ...@@ -462,8 +462,9 @@ bool FLACParser::getSeekPositions(int64_t timeUs,
if (sampleNumber <= targetSampleNumber) { if (sampleNumber <= targetSampleNumber) {
result[0] = (sampleNumber * 1000000LL) / sampleRate; result[0] = (sampleNumber * 1000000LL) / sampleRate;
result[1] = firstFrameOffset + points[i - 1].stream_offset; result[1] = firstFrameOffset + points[i - 1].stream_offset;
if (sampleNumber == targetSampleNumber || i >= length) { if (sampleNumber == targetSampleNumber || i >= length ||
// exact seek, or no following seek point. points[i].sample_number == -1) { // placeholder
// exact seek, or no following non-placeholder seek point
result[2] = result[0]; result[2] = result[0];
result[3] = result[1]; result[3] = result[1];
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment