From cda9417aa6a2bbf2ae933c2b5b86aa3971bb99d9 Mon Sep 17 00:00:00 2001 From: samrobinson Date: Mon, 18 May 2020 10:32:23 +0100 Subject: [PATCH] Allow MP3 files to play with size greater than 2GB. Issue:#7337 PiperOrigin-RevId: 312042768 --- RELEASENOTES.md | 13 ++++++++----- .../exoplayer2/extractor/mp3/XingSeeker.java | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 32ee83129e..d99597535c 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -158,11 +158,14 @@ marked with the `C.ROLE_FLAG_TRICK_PLAY` flag. * Fix assertion failure in `SampleQueue` when playing DASH streams with EMSG tracks ([#7273](https://github.com/google/ExoPlayer/issues/7273)). -* MP3: Add `IndexSeeker` for accurate seeks in VBR streams - ([#6787](https://github.com/google/ExoPlayer/issues/6787)). This seeker is - enabled by passing `FLAG_ENABLE_INDEX_SEEKING` to the `Mp3Extractor`. It may - require to scan a significant portion of the file for seeking, which may be - costly on large files. +* MP3: + * Add `IndexSeeker` for accurate seeks in VBR streams + ([#6787](https://github.com/google/ExoPlayer/issues/6787)). This seeker + is enabled by passing `FLAG_ENABLE_INDEX_SEEKING` to the `Mp3Extractor`. + It may require to scan a significant portion of the file for seeking, + which may be costly on large files. + * Allow MP3 files with XING headers that are larger than 2GB to be played + ([#7337](https://github.com/google/ExoPlayer/issues/7337)). * MP4: Store the Android capture frame rate only in `Format.metadata`. `Format.frameRate` now stores the calculated frame rate. * MPEG-TS: Fix issue where SEI NAL units were incorrectly dropped from H.265 diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp3/XingSeeker.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp3/XingSeeker.java index 9f31fba25e..d95721be5d 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp3/XingSeeker.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp3/XingSeeker.java @@ -64,7 +64,7 @@ import com.google.android.exoplayer2.util.Util; return new XingSeeker(position, mpegAudioHeader.frameSize, durationUs); } - long dataSize = frame.readUnsignedIntToInt(); + long dataSize = frame.readUnsignedInt(); long[] tableOfContents = new long[100]; for (int i = 0; i < 100; i++) { tableOfContents[i] = frame.readUnsignedByte();