[Android] Do not try to resize surface with 0x0 size

Sébastien Toque git at videolan.org
Wed Jan 9 21:18:51 CET 2013


vlc-ports/android | branch: master | Sébastien Toque <xilasz at gmail.com> | Wed Jan  9 21:18:45 2013 +0100| [e624c93bae986fc6575262b1e445e466e75ec318] | committer: Sébastien Toque

Do not try to resize surface with 0x0 size

This can happen if video size equals screen size,
setSurfaceSize is not called since no resize is required,
which means mVideoWidth is not intialized.
In this case, a simple orientation change will trigger
a useless setSurfaceSize(0,0,0,0)

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=e624c93bae986fc6575262b1e445e466e75ec318
---

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index eb6fbe2..a81155d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -475,6 +475,9 @@ public class VideoPlayerActivity extends Activity {
     }
 
     public void setSurfaceSize(int width, int height, int sar_num, int sar_den) {
+        if (width * height == 0)
+            return;
+
         // store video size
         mVideoHeight = height;
         mVideoWidth = width;



More information about the Android mailing list