[Android] MediaPlayer: getChapters(-1) returns chapters of current title.

Thomas Guillem git at videolan.org
Fri Jul 10 20:11:16 CEST 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jul 10 20:09:05 2015 +0200| [85ef0aaca1d94b71e42092c15d838fbb8788f12d] | committer: Thomas Guillem

MediaPlayer: getChapters(-1) returns chapters of current title.

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

 libvlc/src/org/videolan/libvlc/MediaPlayer.java                    |    2 +-
 vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libvlc/src/org/videolan/libvlc/MediaPlayer.java b/libvlc/src/org/videolan/libvlc/MediaPlayer.java
index 778063a..9048dab 100644
--- a/libvlc/src/org/videolan/libvlc/MediaPlayer.java
+++ b/libvlc/src/org/videolan/libvlc/MediaPlayer.java
@@ -508,7 +508,7 @@ public class MediaPlayer extends VLCObject<MediaPlayer.Event> {
     /**
      * Get the full description of available chapters.
      *
-     * @param title index of the title
+     * @param title index of the title (if -1, use the current title)
      * @return the list of Chapters for the title
      */
     public Chapter[] getChapters(int title) {
diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java b/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
index 7ba5c93..a0dbb4f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
@@ -202,7 +202,7 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
     }
 
     private void initChapterSpinner() {
-        final MediaPlayer.Chapter[] chapters = mService.getChapters(mService.getTitleIdx());
+        final MediaPlayer.Chapter[] chapters = mService.getChapters(-1);
         int chaptersCount = chapters != null ? chapters.length : 0;
         if (chaptersCount <= 1){
             mChapters.setVisibility(View.GONE);



More information about the Android mailing list