[Android] LibVLC: send initial encodings from registerAudioPlugV21

Thomas Guillem git at videolan.org
Wed Mar 8 15:07:27 CET 2017


vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Mar  8 10:19:28 2017 +0100| [69a8f5f84cec36eefc9096aba79ff1e2d418ad22] | committer: Thomas Guillem

LibVLC: send initial encodings from registerAudioPlugV21

Get the already existing audio plug sticky intent (if exists) and process it.

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

 libvlc/src/org/videolan/libvlc/MediaPlayer.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libvlc/src/org/videolan/libvlc/MediaPlayer.java b/libvlc/src/org/videolan/libvlc/MediaPlayer.java
index 44936a4..6b0bcd1 100644
--- a/libvlc/src/org/videolan/libvlc/MediaPlayer.java
+++ b/libvlc/src/org/videolan/libvlc/MediaPlayer.java
@@ -439,7 +439,9 @@ public class MediaPlayer extends VLCObject<MediaPlayer.Event> {
     private void registerAudioPlugV21(boolean register) {
         if (register) {
             final IntentFilter intentFilter = new IntentFilter(AudioManager.ACTION_HDMI_AUDIO_PLUG);
-            mLibVLC.mAppContext.registerReceiver(mAudioPlugReceiver, intentFilter);
+            final Intent stickyIntent = mLibVLC.mAppContext.registerReceiver(mAudioPlugReceiver, intentFilter);
+            if (stickyIntent != null)
+                mAudioPlugReceiver.onReceive(mLibVLC.mAppContext, stickyIntent);
         } else {
             mLibVLC.mAppContext.unregisterReceiver(mAudioPlugReceiver);
         }



More information about the Android mailing list