Skip to content

Commit ecac78f

Browse files
icbakercopybara-github
authored andcommitted
MP3 CBR fallback: Remove null check and add a comment
PiperOrigin-RevId: 735708126
1 parent 44b3a43 commit ecac78f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

libraries/extractor/src/main/java/androidx/media3/extractor/mp3/Mp3Extractor.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -503,15 +503,14 @@ private Seeker computeSeeker(ExtractorInput input) throws IOException {
503503

504504
if (resultSeeker == null
505505
|| (!resultSeeker.isSeekable() && (flags & FLAG_ENABLE_CONSTANT_BITRATE_SEEKING) != 0)) {
506+
// Either we found no seek or VBR info, so we must assume the file is CBR (even without the
507+
// flag(s) being set), or an 'enable CBR seeking flag' is set and we found some seek info,
508+
// but not enough to seek with. In either case, we fall back to CBR seeking.
506509
resultSeeker =
507510
getConstantBitrateSeeker(
508511
input, (flags & FLAG_ENABLE_CONSTANT_BITRATE_SEEKING_ALWAYS) != 0);
509512
}
510-
511-
if (resultSeeker != null) {
512-
realTrackOutput.durationUs(resultSeeker.getDurationUs());
513-
}
514-
513+
realTrackOutput.durationUs(resultSeeker.getDurationUs());
515514
return resultSeeker;
516515
}
517516

0 commit comments

Comments
 (0)