]> git.sesse.net Git - vlc/commitdiff
androidsurface: Only use ANativeWindow if the private symbols aren't found
authorMartin Storsjö <martin@martin.st>
Mon, 29 Jul 2013 07:55:42 +0000 (10:55 +0300)
committerMartin Storsjö <martin@martin.st>
Mon, 29 Jul 2013 08:01:56 +0000 (11:01 +0300)
Even if ANativeWindow is a public API, the release call seems to
crash on a Nexus One (running 2.3) and on a Galaxy Tab (running 3.2).
The exact reason is not known or understood yet, but it might be
due to accessing and dealing with the Surface from both Java (via the
SurfaceHolder class) and via the ANativeWindow API.

Therefore, only use the ANativeWindow if the old methods aren't
found (that is, on 4.3).

The ANativeWindow output works fine on firmwares as early as 4.0
though.

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

index ae70bc3e855434f99c317c2a7ec40b9a7e81c394..d0cbbd1d715960191a4e6aa183f4f25d80a2bedb 100644 (file)
@@ -219,9 +219,9 @@ static int Open(vlc_object_t *p_this)
     }
 
     /* */
-    sys->p_library = InitLibrary2(sys);
+    sys->p_library = InitLibrary(sys);
     if (!sys->p_library)
-        sys->p_library = InitLibrary(sys);
+        sys->p_library = InitLibrary2(sys);
     if (!sys->p_library) {
         free(sys);
         msg_Err(vd, "Could not initialize libandroid.so/libui.so/libgui.so/libsurfaceflinger_client.so!");