File tree Expand file tree Collapse file tree
libraries/extractor/src/main/java/androidx/media3/extractor/mp3 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -399,18 +399,11 @@ private long computeTimeUs(long samplesRead) {
399399 * initially gapless Xing/Info duration with the longer encoded duration.
400400 */
401401 private long computeFinalIndexSeekerDurationUs (long samplesRead ) {
402- long durationUs = computeTimeUs (samplesRead );
403- if (!gaplessInfoHolder .hasGaplessInfo ()) {
404- return durationUs ;
405- }
406402 long finalGaplessSampleIndex =
407- Util .durationUsToSampleCount (durationUs , synchronizedHeader .sampleRate )
408- - gaplessInfoHolder .encoderDelay
409- - gaplessInfoHolder .encoderPadding
410- - 1 ;
411- return finalGaplessSampleIndex >= 0
412- ? Util .sampleCountToDurationUs (finalGaplessSampleIndex , synchronizedHeader .sampleRate )
413- : C .TIME_UNSET ;
403+ gaplessInfoHolder .hasGaplessInfo ()
404+ ? samplesRead - gaplessInfoHolder .encoderDelay - gaplessInfoHolder .encoderPadding - 1
405+ : samplesRead ;
406+ return finalGaplessSampleIndex >= 0 ? computeTimeUs (finalGaplessSampleIndex ) : C .TIME_UNSET ;
414407 }
415408
416409 private boolean synchronize (ExtractorInput input , boolean sniffing ) throws IOException {
You can’t perform that action at this time.
0 commit comments