[Android] PlaybackService: Fix restoration of audio pause state

Jean-Baptiste Kempf git at videolan.org
Mon Sep 26 12:01:51 CEST 2016


vlc-android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Sep 26 11:58:43 2016 +0200| [b5e5b713f6ab19755998aea3db8655b15cd9e02e] | committer: Jean-Baptiste Kempf

PlaybackService: Fix restoration of audio pause state

If one had both AUDIOFOCUS_LOSS_TRANSIENT and AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK events,
then we did not resume audio playback.

> https://code.videolan.org/videolan/vlc-android/commit/b5e5b713f6ab19755998aea3db8655b15cd9e02e
---

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

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 77d22ef..e80f6e7 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -365,7 +365,8 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
                         if (mLossTransientVolume != -1) {
                             mMediaPlayer.setVolume(mLossTransientVolume);
                             mLossTransientVolume = -1;
-                        } else if (mLossTransient) {
+                        }
+                        if (mLossTransient) {
                             if (wasPlaying)
                                 mMediaPlayer.play();
                             mLossTransient = false;



More information about the Android mailing list