Flac extension: disable BinarySearchSeeker if totalSamples is unknown

The ceilingTimePosition is based on the total number of samples. Binary
search seeking is not possible if this value is unknown.

PiperOrigin-RevId: 292921177
This commit is contained in:
kimvde 2020-02-03 16:05:58 +00:00 committed by kim-vde
parent cfda4a5870
commit 792d9b39e0

View file

@ -250,7 +250,7 @@ public final class FlacExtractor implements Extractor {
SeekMap seekMap;
if (haveSeekTable) {
seekMap = new FlacSeekMap(streamMetadata.getDurationUs(), decoderJni);
} else if (streamLength != C.LENGTH_UNSET) {
} else if (streamLength != C.LENGTH_UNSET && streamMetadata.totalSamples > 0) {
long firstFramePosition = decoderJni.getDecodePosition();
binarySearchSeeker =
new FlacBinarySearchSeeker(