mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Avoid OMX.qti.audio.decoder.flac
Unfortunately devices such as the MI 8 do not provide an alternative working decoder. Some Vivo devices do provide one though. PiperOrigin-RevId: 288911897
This commit is contained in:
parent
9cdbc822bb
commit
7e5d6debcc
1 changed files with 12 additions and 1 deletions
|
|
@ -566,7 +566,9 @@ public final class MediaCodecUtil {
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
} else if (Util.SDK_INT < 21 && decoderInfos.size() > 1) {
|
}
|
||||||
|
|
||||||
|
if (Util.SDK_INT < 21 && decoderInfos.size() > 1) {
|
||||||
String firstCodecName = decoderInfos.get(0).name;
|
String firstCodecName = decoderInfos.get(0).name;
|
||||||
if ("OMX.SEC.mp3.dec".equals(firstCodecName)
|
if ("OMX.SEC.mp3.dec".equals(firstCodecName)
|
||||||
|| "OMX.SEC.MP3.Decoder".equals(firstCodecName)
|
|| "OMX.SEC.MP3.Decoder".equals(firstCodecName)
|
||||||
|
|
@ -578,6 +580,15 @@ public final class MediaCodecUtil {
|
||||||
sortByScore(decoderInfos, decoderInfo -> decoderInfo.name.startsWith("OMX.google") ? 1 : 0);
|
sortByScore(decoderInfos, decoderInfo -> decoderInfo.name.startsWith("OMX.google") ? 1 : 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Util.SDK_INT < 30 && decoderInfos.size() > 1) {
|
||||||
|
String firstCodecName = decoderInfos.get(0).name;
|
||||||
|
// Prefer anything other than OMX.qti.audio.decoder.flac on older devices. See [Internal
|
||||||
|
// ref: b/147278539] and [Internal ref: b/147354613].
|
||||||
|
if ("OMX.qti.audio.decoder.flac".equals(firstCodecName)) {
|
||||||
|
decoderInfos.add(decoderInfos.remove(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue