mirror of
https://github.com/WiVRn/WiVRn.git
synced 2026-11-20 09:01:39 -08:00
Avoid segfault in android decoder if the codec is not supported
This commit is contained in:
1 parent
ab126dd9b7
commit
08d19bd94d
1 file changed
+3
@@ -118,6 +118,9 @@ decoder::decoder(
|
||||
|
||||
media_codec.reset(AMediaCodec_createDecoderByType(mime(description.codec)));
|
||||
|
||||
if (not media_codec)
|
||||
throw std::runtime_error(std::string("Cannot create decoder for MIME type ") + mime(description.codec));
|
||||
|
||||
char * codec_name;
|
||||
check(AMediaCodec_getName(media_codec.get(), &codec_name), "AMediaCodec_getName");
|
||||
spdlog::info("Created MediaCodec decoder \"{}\"", codec_name);
|
||||
|
||||
Reference in new issue
Block a user