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

Thomas Guillem thomas at gllm.fr
Wed Jan 21 18:57:12 CET 2015



On Wed, Jan 21, 2015, at 17:33, Thomas Guillem wrote:
> ---
>  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
> 

Please forget these 4 patches.
I'll do something better.


More information about the Android mailing list