Commit 08e519a4 authored by Thomas Guillem's avatar Thomas Guillem

android: AWindowHandler_releaseSurface now release the ANativeWindow

parent 52e2e90f
......@@ -431,10 +431,7 @@ static void StopMediaCodec(decoder_t *p_dec)
p_sys->api->stop(p_sys->api);
if (p_dec->fmt_in.i_cat == VIDEO_ES && p_sys->u.video.p_awh)
{
AWindowHandler_releaseANativeWindow(p_sys->u.video.p_awh, AWindow_Video);
AWindowHandler_releaseSurface(p_sys->u.video.p_awh, AWindow_Video);
}
}
/*****************************************************************************
......
......@@ -514,6 +514,7 @@ static void
AWindowHandler_releaseSurfaceEnv(AWindowHandler *p_awh, JNIEnv *p_env,
enum AWindow_ID id)
{
AWindowHandler_releaseANativeWindow(p_awh, id);
if (p_awh->views[id].jsurface)
{
(*p_env)->DeleteGlobalRef(p_env, p_awh->views[id].jsurface);
......@@ -526,9 +527,6 @@ AWindowHandler_destroy(AWindowHandler *p_awh)
{
JNIEnv *p_env = AWindowHandler_getEnv(p_awh);
AWindowHandler_releaseANativeWindow(p_awh, AWindow_Video);
AWindowHandler_releaseANativeWindow(p_awh, AWindow_Subtitles);
if (p_env)
{
if (p_awh->event.b_registered)
......
......@@ -148,7 +148,8 @@ void AWindowHandler_releaseSurface(AWindowHandler *p_awh, enum AWindow_ID id);
/**
* This function returns the Video or the Subtitles ANativeWindow attached to
* the Android Surface. It can be released with
* AWindowHandler_releaseANativeWindow or by AWindowHandler_destroy.
* AWindowHandler_releaseANativeWindow, AWindowHandler_releaseSurface or by
* AWindowHandler_destroy.
*/
ANativeWindow *AWindowHandler_getANativeWindow(AWindowHandler *p_awh,
enum AWindow_ID id);
......
Markdown is supported
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