Skip to content

Commit

Permalink
Enable CBR seeking for files with unknown length in AmrExtractor
Browse files Browse the repository at this point in the history
Constant bit rate (CBR) seeking can be enabled even when the length of the file is not known.

Additionally, dump files for these files have been updated to accurately log the `position` when `timeUs` is set to `0`.

PiperOrigin-RevId: 662868607
  • Loading branch information
rohitjoins authored and copybara-github committed Aug 14, 2024
1 parent ca455ee commit e9cfd72
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ private void maybeOutputSeekMap(long inputLength, int sampleReadResult) {
}

if ((flags & FLAG_ENABLE_CONSTANT_BITRATE_SEEKING) == 0
|| inputLength == C.LENGTH_UNSET
|| (firstSampleSize != C.LENGTH_UNSET && firstSampleSize != currentSampleSize)) {
seekMap = new SeekMap.Unseekable(C.TIME_UNSET);
extractorOutput.seekMap(seekMap);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
seekMap:
isSeekable = false
duration = UNSET TIME
getPosition(0) = [[timeUs=0, position=0]]
getPosition(0) = [[timeUs=0, position=6]]
numberOfTracks = 1
track 0:
total output bytes = 2834
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
seekMap:
isSeekable = false
duration = UNSET TIME
getPosition(0) = [[timeUs=0, position=0]]
getPosition(0) = [[timeUs=0, position=9]]
numberOfTracks = 1
track 0:
total output bytes = 4056
Expand Down

0 comments on commit e9cfd72

Please sign in to comment.