mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix FLAC seeking when the last seek point is a placeholder
PiperOrigin-RevId: 285449865
This commit is contained in:
parent
5e822e160e
commit
739517bd5e
1 changed files with 3 additions and 2 deletions
|
|
@ -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…
Reference in a new issue