Commit 4f5af4a4 authored by Thomas Guillem's avatar Thomas Guillem
Browse files

mediacodec: fix Android error callback not sent in case of early fail

This is the last android ugly hack. This will be gone with the decoder fallback.
parent 1e6811fe
......@@ -1473,8 +1473,9 @@ end:
if (!p_sys->b_error_signaled) {
/* Signal the error to the Java.
* TODO: remove this when there is a decoder fallback */
if (p_dec->fmt_in.i_cat == VIDEO_ES && p_sys->u.video.p_awh)
AWindowHandler_sendHardwareAccelerationError(p_sys->u.video.p_awh);
if (p_dec->fmt_in.i_cat == VIDEO_ES)
AWindowHandler_sendHardwareAccelerationError(VLC_OBJECT(p_dec),
p_sys->u.video.p_awh);
p_sys->b_error_signaled = true;
vlc_cond_broadcast(&p_sys->cond);
}
......
......@@ -752,12 +752,29 @@ AWindowHandler_setWindowLayout(AWindowHandler *p_awh,
}
int
AWindowHandler_sendHardwareAccelerationError(AWindowHandler *p_awh)
AWindowHandler_sendHardwareAccelerationError(vlc_object_t *p_obj,
AWindowHandler *p_awh)
{
JNIEnv *p_env = AWindowHandler_getEnv(p_awh);
assert(p_obj || p_awh);
JNIEnv *p_env;
if (p_awh)
{
p_env = AWindowHandler_getEnv(p_awh);
p_awh = NULL;
}
else
{
p_awh = AWindowHandler_new(p_obj);
if (!p_awh)
return VLC_EGENERIC;
p_env = AWindowHandler_getEnv(p_awh);
}
if (!p_env)
return VLC_EGENERIC;
JNI_CALL(CallVoidMethod, sendHardwareAccelerationError);
if (p_awh)
AWindowHandler_destroy(p_awh);
return VLC_SUCCESS;
}
......@@ -175,4 +175,4 @@ int AWindowHandler_setWindowLayout(AWindowHandler *p_awh,
/* Signal a critical error
* TODO: remove this when there is a decoder fallback */
int
AWindowHandler_sendHardwareAccelerationError(AWindowHandler *p_awh);
AWindowHandler_sendHardwareAccelerationError(vlc_object_t *p_obj, AWindowHandler *p_awh);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment