mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Fix FLAC seeking when the last seek point is a placeholder
PiperOrigin-RevId: 285449865
This commit is contained in:
parent
b3f485d7d9
commit
8bafd6ff7d
@ -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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user