mirror of
https://github.com/samsonjs/media.git
synced 2026-03-25 09:25:53 +00:00
Use removeKey method instead of setting null for KEY_CODECS_STRING
Setting a `null` value doesn't remove the key as expected per the `MediaFormat` API documentation, using the `removeKey` method instead which is only available starting API level 29. PiperOrigin-RevId: 646462402
This commit is contained in:
parent
5fcc7433a1
commit
12c42585d2
1 changed files with 3 additions and 1 deletions
|
|
@ -647,7 +647,9 @@ public final class MediaExtractorCompat {
|
|||
MediaFormat mediaFormatResult = MediaFormatUtil.createMediaFormatFromFormat(result);
|
||||
scratchFormatHolder.clear();
|
||||
if (compatibilityTrackMimeType != null) {
|
||||
mediaFormatResult.setString(MediaFormat.KEY_CODECS_STRING, null);
|
||||
if (Util.SDK_INT >= 29) {
|
||||
mediaFormatResult.removeKey(MediaFormat.KEY_CODECS_STRING);
|
||||
}
|
||||
mediaFormatResult.setString(MediaFormat.KEY_MIME, compatibilityTrackMimeType);
|
||||
}
|
||||
return mediaFormatResult;
|
||||
|
|
|
|||
Loading…
Reference in a new issue