[Android] VideoPlayer: fix video ts opened as audio
Thomas Guillem
git at videolan.org
Tue Mar 17 19:24:22 CET 2015
vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Mar 17 19:23:11 2015 +0100| [d36723413d3fc86cb0db30a27cf3941170b4d257] | committer: Thomas Guillem
VideoPlayer: fix video ts opened as audio
MediaParsedChanged can be sent when there is no ES at all.
Use the MediaPlayerESAdded event instead.
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=d36723413d3fc86cb0db30a27cf3941170b4d257
---
.../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
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 dc42e17..2ad63cc 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1325,12 +1325,7 @@ public class VideoPlayerActivity extends ActionBarActivity implements IVideoPlay
switch (msg.getData().getInt("event")) {
case EventHandler.MediaParsedChanged:
- Log.i(TAG, "MediaParsedChanged");
activity.updateNavStatus();
- if (!activity.mHasMenu && activity.mLibVLC.getVideoTracksCount() < 1) {
- Log.i(TAG, "No video track, open in audio mode");
- activity.switchToAudioMode();
- }
break;
case EventHandler.MediaPlayerPlaying:
Log.i(TAG, "MediaPlayerPlaying");
@@ -1382,6 +1377,12 @@ public class VideoPlayerActivity extends ActionBarActivity implements IVideoPlay
case EventHandler.MediaPlayerTimeChanged:
// avoid useless error logs
break;
+ case EventHandler.MediaPlayerESAdded:
+ if (!activity.mHasMenu && activity.mLibVLC.getVideoTracksCount() < 1) {
+ Log.i(TAG, "No video track, open in audio mode");
+ activity.switchToAudioMode();
+ }
+ break;
default:
break;
}
More information about the Android
mailing list