Merge pull request #1367 from TheBeastLT:main

PiperOrigin-RevId: 634289663
This commit is contained in:
Copybara-Service 2024-05-16 03:26:32 -07:00
commit a4faf4db6f
2 changed files with 5 additions and 1 deletions

View File

@ -82,6 +82,9 @@
* Apps with custom `SubtitleDecoder` implementations need to update * Apps with custom `SubtitleDecoder` implementations need to update
them to implement `SubtitleParser` instead (and them to implement `SubtitleParser` instead (and
`SubtitleParser.Factory` instead of `SubtitleDecoderFactory`). `SubtitleParser.Factory` instead of `SubtitleDecoderFactory`).
* PGS: Fix run-length decoding to resolve `0` as a color index, instead of
a literal color value
([#1367](https://github.com/androidx/media/pull/1367)).
* Metadata: * Metadata:
* Fix mapping of MP4 to ID3 sort tags. Previously the 'album sort' * Fix mapping of MP4 to ID3 sort tags. Previously the 'album sort'
(`soal`), 'artist sort' (`soar`) and 'album artist sort' (`soaa`) MP4 (`soal`), 'artist sort' (`soar`) and 'album artist sort' (`soaa`) MP4

View File

@ -248,7 +248,8 @@ public final class PgsParser implements SubtitleParser {
(switchBits & 0x40) == 0 (switchBits & 0x40) == 0
? (switchBits & 0x3F) ? (switchBits & 0x3F)
: (((switchBits & 0x3F) << 8) | bitmapData.readUnsignedByte()); : (((switchBits & 0x3F) << 8) | bitmapData.readUnsignedByte());
int color = (switchBits & 0x80) == 0 ? 0 : colors[bitmapData.readUnsignedByte()]; int color =
(switchBits & 0x80) == 0 ? colors[0] : colors[bitmapData.readUnsignedByte()];
Arrays.fill( Arrays.fill(
argbBitmapData, argbBitmapDataIndex, argbBitmapDataIndex + runLength, color); argbBitmapData, argbBitmapDataIndex, argbBitmapDataIndex + runLength, color);
argbBitmapDataIndex += runLength; argbBitmapDataIndex += runLength;