}
}
- ConfigureMediaCodec();
+ if (!ConfigureMediaCodec())
+ {
+ m_codec.reset();
+ SAFE_DELETE(m_bitstream);
+ return false;
+ }
// setup a YUV420P DVDVideoPicture buffer.
// first make sure all properties are reset.
}
}
-void CDVDVideoCodecAndroidMediaCodec::ConfigureMediaCodec(void)
+bool CDVDVideoCodecAndroidMediaCodec::ConfigureMediaCodec(void)
{
// setup a MediaFormat to match the video content,
// used by codec during configure
{
m_codec->configure(mediaformat, *m_surface, crypto, flags);
}
+ // always, check/clear jni exceptions.
+ if (xbmc_jnienv()->ExceptionOccurred())
+ {
+ xbmc_jnienv()->ExceptionClear();
+ return false;
+ }
- m_codec->start();
+ m_codec->start();
// always, check/clear jni exceptions.
if (xbmc_jnienv()->ExceptionOccurred())
+ {
xbmc_jnienv()->ExceptionClear();
+ return false;
+ }
+
+ return true;
}
int CDVDVideoCodecAndroidMediaCodec::GetOutputPicture(void)