[Android] [PATCH 4/4] AudioService: don't open VideoPlayer is VLC is not on foreground

Thomas Guillem thomas at gllm.fr
Wed Jan 21 17:33:14 CET 2015


---
 vlc-android/src/org/videolan/vlc/audio/AudioService.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/audio/AudioService.java b/vlc-android/src/org/videolan/vlc/audio/AudioService.java
index 08bf35b..8199257 100644
--- a/vlc-android/src/org/videolan/vlc/audio/AudioService.java
+++ b/vlc-android/src/org/videolan/vlc/audio/AudioService.java
@@ -612,7 +612,8 @@ public class AudioService extends Service {
     };
 
     private void handleVout() {
-        if (!hasCurrentMedia())
+        VLCApplication app = (VLCApplication) getApplication();
+        if (!hasCurrentMedia() || !app.isOnForeground())
             return;
         Log.i(TAG, "Obtained video track");
         String title = getCurrentMedia().getTitle();
-- 
2.1.3



More information about the Android mailing list