mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 20:48:43 +00:00
Fallback to matching video decoder by MIME type.
This commit is contained in:
committed by
Greyson Parrelli
parent
9dc856202a
commit
fc1d60e65b
@@ -39,6 +39,13 @@ object MediaCodecCompat {
|
||||
} else {
|
||||
findBackupDecoderForDolbyVision(inputFormat) ?: throw IOException("Can't create decoder for $mimeType!")
|
||||
}
|
||||
} else if (mimeType != null) {
|
||||
try {
|
||||
val decoder = MediaCodec.createDecoderByType(mimeType)
|
||||
return Pair(decoder, inputFormat)
|
||||
} catch (iae: IllegalArgumentException) {
|
||||
throw IOException("Can't create decoder for $mimeType, which is not a valid MIME type.", iae)
|
||||
}
|
||||
}
|
||||
|
||||
throw IOException("Can't create decoder for $mimeType!")
|
||||
|
||||
Reference in New Issue
Block a user