[Android] Media: Do not display non-sensical infos

Jean-Baptiste Kempf git at videolan.org
Tue Jun 19 20:39:53 CEST 2012


android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Jun 19 20:37:14 2012 +0200| [065060fec0f325045e6a1b9c23910a21a89bc564] | committer: Jean-Baptiste Kempf

Media: Do not display non-sensical infos

Close #6972 #6973

> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=065060fec0f325045e6a1b9c23910a21a89bc564
---

 vlc-android/src/org/videolan/vlc/gui/video/MediaInfoAdapter.java |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoAdapter.java b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoAdapter.java
index 6b24fc9..74df77c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoAdapter.java
@@ -93,8 +93,10 @@ public class MediaInfoAdapter extends ArrayAdapter<TrackInfo> {
     }
 
     private void appendVideo(StringBuilder textBuilder, Resources res, TrackInfo track) {
-        textBuilder.append(res.getString(R.string.track_resolution_info, track.Width, track.Height));
-        textBuilder.append(res.getString(R.string.track_framerate_info, track.Framerate));
+        if( track.Width != 0 && track.Height != 0 )
+            textBuilder.append(res.getString(R.string.track_resolution_info, track.Width, track.Height));
+    	if( !Float.isNaN(track.Framerate) )
+            textBuilder.append(res.getString(R.string.track_framerate_info, track.Framerate));
     }
 
     static class ViewHolder {



More information about the Android mailing list