[Android] Fix play as audio to actually play as audio

Edward Wang git at videolan.org
Fri Feb 8 05:23:47 CET 2013


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Thu Feb  7 23:23:08 2013 -0500| [18ff04ee982fcf06cea6d6f23146135a2630dab9] | committer: Edward Wang

Fix play as audio to actually play as audio

Ref #7071

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=18ff04ee982fcf06cea6d6f23146135a2630dab9
---

 vlc-android/src/org/videolan/vlc/AudioService.java             |    4 ++--
 vlc-android/src/org/videolan/vlc/AudioServiceController.java   |    8 ++++----
 vlc-android/src/org/videolan/vlc/LibVLC.java                   |    1 +
 .../src/org/videolan/vlc/gui/DirectoryViewFragment.java        |    2 +-
 vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java      |    2 +-
 vlc-android/src/org/videolan/vlc/interfaces/IAudioService.aidl |    2 +-
 6 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/AudioService.java b/vlc-android/src/org/videolan/vlc/AudioService.java
index 83b9991..d238636 100644
--- a/vlc-android/src/org/videolan/vlc/AudioService.java
+++ b/vlc-android/src/org/videolan/vlc/AudioService.java
@@ -738,7 +738,7 @@ public class AudioService extends Service {
         }
 
         @Override
-        public void load(List<String> mediaPathList, int position, boolean libvlcBacked)
+        public void load(List<String> mediaPathList, int position, boolean libvlcBacked, boolean noVideo)
                 throws RemoteException {
             mLibVLCPlaylistActive = libvlcBacked;
 
@@ -772,7 +772,7 @@ public class AudioService extends Service {
                 if(mLibVLCPlaylistActive) {
                     mLibVLC.playIndex(position);
                 } else {
-                    mLibVLC.readMedia(mCurrentMedia.getLocation());
+                    mLibVLC.readMedia(mCurrentMedia.getLocation(), noVideo);
                 }
                 setUpRemoteControlClient();
                 showNotification();
diff --git a/vlc-android/src/org/videolan/vlc/AudioServiceController.java b/vlc-android/src/org/videolan/vlc/AudioServiceController.java
index 15a49c0..2dcd826 100644
--- a/vlc-android/src/org/videolan/vlc/AudioServiceController.java
+++ b/vlc-android/src/org/videolan/vlc/AudioServiceController.java
@@ -210,13 +210,13 @@ public class AudioServiceController implements IAudioPlayerControl {
     }
 
     public void load(List<String> mediaPathList, int position) {
-        load(mediaPathList, position, false);
+        load(mediaPathList, position, false, false);
     }
 
-    public void load(List<String> mediaPathList, int position, boolean libvlcBacked) {
+    public void load(List<String> mediaPathList, int position, boolean libvlcBacked, boolean noVideo) {
         remoteProcedureCall(mAudioServiceBinder, Void.class, (Void)null, "load",
-                new Class<?>[] { List.class, int.class, boolean.class },
-                new Object[] { mediaPathList, position, libvlcBacked } );
+                new Class<?>[] { List.class, int.class, boolean.class, boolean.class },
+                new Object[] { mediaPathList, position, libvlcBacked, noVideo } );
     }
 
     public void append(List<String> mediaPathList) {
diff --git a/vlc-android/src/org/videolan/vlc/LibVLC.java b/vlc-android/src/org/videolan/vlc/LibVLC.java
index ceeae5c..df4ba14 100644
--- a/vlc-android/src/org/videolan/vlc/LibVLC.java
+++ b/vlc-android/src/org/videolan/vlc/LibVLC.java
@@ -334,6 +334,7 @@ public class LibVLC {
      * Read a media
      * @param instance: the instance of libVLC
      * @param mrl: the media mrl
+     * @param novideo: don't enable video decoding for this media
      * @return the position in the playlist
      */
     private native int readMedia(long instance, String mrl, boolean novideo);
diff --git a/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java b/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
index 17e0c3f..7ef59b8 100644
--- a/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
@@ -146,7 +146,7 @@ public class DirectoryViewFragment extends SherlockListFragment implements ISort
             AudioServiceController audioController = AudioServiceController.getInstance();
             ArrayList<String> arrayList = new ArrayList<String>();
             arrayList.add(mediaLocation);
-            audioController.load(arrayList, 0);
+            audioController.load(arrayList, 0, false, true);
             AudioPlayerActivity.start(getActivity());
         } else if(id == R.id.directory_view_play_video) {
             VideoPlayerActivity.start(getActivity(), mediaLocation);
diff --git a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
index 6abe97b..fc6b98b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
@@ -61,7 +61,7 @@ public class HistoryFragment extends SherlockListFragment {
     public void onListItemClick(ListView l, View v, int p, long id) {
         AudioServiceController audioController = AudioServiceController.getInstance();
 
-        audioController.load(mHistoryAdapter.getAllURIs(), p, true);
+        audioController.load(mHistoryAdapter.getAllURIs(), p, true, true);
         Intent intent = new Intent(getActivity(), AudioPlayerActivity.class);
         intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
         startActivity(intent);
diff --git a/vlc-android/src/org/videolan/vlc/interfaces/IAudioService.aidl b/vlc-android/src/org/videolan/vlc/interfaces/IAudioService.aidl
index 7097e7c..21edaea 100644
--- a/vlc-android/src/org/videolan/vlc/interfaces/IAudioService.aidl
+++ b/vlc-android/src/org/videolan/vlc/interfaces/IAudioService.aidl
@@ -30,7 +30,7 @@ interface IAudioService {
     void shuffle();
     void setTime(long time);
     String getCurrentMediaLocation();
-    void load(in List<String> mediaPathList, int position, boolean libvlcBacked);
+    void load(in List<String> mediaPathList, int position, boolean libvlcBacked, boolean noVideo);
     void append(in List<String> mediaPathList);
     List<String> getItems();
     String getItem();



More information about the Android mailing list