[Android] set media only when we actually play it
Geoffrey Métais
git at videolan.org
Fri Apr 1 12:03:53 CEST 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Mar 25 17:35:25 2016 +0100| [dd5e7fcd5411b56af93a5f91aa2daeb877857f00] | committer: Geoffrey Métais
set media only when we actually play it
> https://code.videolan.org/videolan/vlc-android/commit/dd5e7fcd5411b56af93a5f91aa2daeb877857f00
---
vlc-android/src/org/videolan/vlc/PlaybackService.java | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 7bcf304..1b02cdd 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -1676,17 +1676,18 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
return;
if (mw.getType() == MediaWrapper.TYPE_VIDEO && isVideoPlaying())
mw.addFlags(MediaWrapper.MEDIA_VIDEO);
+ if (mw .getType() != MediaWrapper.TYPE_VIDEO || mw.hasFlag(MediaWrapper.MEDIA_FORCE_AUDIO) || isVideoPlaying()) {
/* Pausable and seekable are true by default */
- mParsed = false;
- mSwitchingToVideo = false;
- mPausable = mSeekable = true;
- final Media media = new Media(VLCInstance.get(), mw.getUri());
- VLCOptions.setMediaOptions(media, this, flags | mw.getFlags());
- media.setEventListener(mMediaListener);
- mMediaPlayer.setMedia(media);
- media.release();
- if (mw .getType() != MediaWrapper.TYPE_VIDEO || mw.hasFlag(MediaWrapper.MEDIA_FORCE_AUDIO) || isVideoPlaying()) {
+ mParsed = false;
+ mSwitchingToVideo = false;
+ mPausable = mSeekable = true;
+ final Media media = new Media(VLCInstance.get(), mw.getUri());
+ VLCOptions.setMediaOptions(media, this, flags | mw.getFlags());
+ media.setEventListener(mMediaListener);
+ mMediaPlayer.setMedia(media);
+ media.release();
+
mMediaPlayer.setEqualizer(VLCOptions.getEqualizer(this));
mMediaPlayer.setVideoTitleDisplay(MediaPlayer.Position.Disable, 0);
changeAudioFocus(true);
More information about the Android
mailing list