androidsurface: Release the ANativeWindow before closing the dlopened library
authorMartin Storsjö <martin@martin.st>
Mon, 29 Jul 2013 14:05:36 +0000 (17:05 +0300)
committerMartin Storsjö <martin@martin.st>
Mon, 29 Jul 2013 14:11:10 +0000 (17:11 +0300)
This fixes ANativeWindow usage on 2.3 and 3.x. Therefore, revert
back to preferring ANativeWindow over the private symbols.

Signed-off-by: Martin Storsjö <martin@martin.st>
modules/video_output/androidsurface.c

index d0cbbd1..a2383a5 100644 (file)
@@ -219,9 +219,9 @@ static int Open(vlc_object_t *p_this)
     }
 
     /* */
-    sys->p_library = InitLibrary(sys);
+    sys->p_library = InitLibrary2(sys);
     if (!sys->p_library)
-        sys->p_library = InitLibrary2(sys);
+        sys->p_library = InitLibrary(sys);
     if (!sys->p_library) {
         free(sys);
         msg_Err(vd, "Could not initialize libandroid.so/libui.so/libgui.so/libsurfaceflinger_client.so!");
@@ -323,9 +323,9 @@ static void Close(vlc_object_t *p_this)
     vout_display_sys_t *sys = vd->sys;
 
     picture_pool_Delete(sys->pool);
-    dlclose(sys->p_library);
     if (sys->window)
         sys->s_winRelease(sys->window);
+    dlclose(sys->p_library);
     free(sys);
     vlc_mutex_unlock(&single_instance);
 }