mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
take byte offset into account when unsynchronizing an id3 frame
Issue #5673 PiperOrigin-RevId: 241328598
This commit is contained in:
parent
5fd4fddfac
commit
e612511afc
2 changed files with 6 additions and 3 deletions
|
|
@ -90,7 +90,8 @@
|
||||||
* Prevent seeking when ICY metadata is present to prevent playback problems
|
* Prevent seeking when ICY metadata is present to prevent playback problems
|
||||||
([#5658](https://github.com/google/ExoPlayer/issues/5658)).
|
([#5658](https://github.com/google/ExoPlayer/issues/5658)).
|
||||||
* Use full BCP 47 language tags in `Format`.
|
* Use full BCP 47 language tags in `Format`.
|
||||||
* Select audio track based on system language if no preference is provided.
|
* Take byte offset into account when unsynchronizing an id3 frame
|
||||||
|
([#5673](https://github.com/google/ExoPlayer/issues/5673)).
|
||||||
|
|
||||||
### 2.9.6 ###
|
### 2.9.6 ###
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -713,9 +713,11 @@ public final class Id3Decoder implements MetadataDecoder {
|
||||||
*/
|
*/
|
||||||
private static int removeUnsynchronization(ParsableByteArray data, int length) {
|
private static int removeUnsynchronization(ParsableByteArray data, int length) {
|
||||||
byte[] bytes = data.data;
|
byte[] bytes = data.data;
|
||||||
for (int i = data.getPosition(); i + 1 < length; i++) {
|
int startPosition = data.getPosition();
|
||||||
|
for (int i = startPosition; i + 1 < startPosition + length; i++) {
|
||||||
if ((bytes[i] & 0xFF) == 0xFF && bytes[i + 1] == 0x00) {
|
if ((bytes[i] & 0xFF) == 0xFF && bytes[i + 1] == 0x00) {
|
||||||
System.arraycopy(bytes, i + 2, bytes, i + 1, length - i - 2);
|
int relativePosition = i - startPosition;
|
||||||
|
System.arraycopy(bytes, i + 2, bytes, i + 1, length - relativePosition - 2);
|
||||||
length--;
|
length--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue