[Android] VideoPlayerActivity: fix off-by-one error in audio track selection

Edward Wang git at videolan.org
Sat Dec 22 05:39:02 CET 2012


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Fri Dec 21 23:31:02 2012 -0500| [10bb075bb487d434977120658937085b35a5dbff] | committer: Edward Wang

VideoPlayerActivity: fix off-by-one error in audio track selection

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

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java      |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 17748db..e105aaa 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -881,14 +881,14 @@ public class VideoPlayerActivity extends Activity {
             arrList = mAudioTracksList.toArray(arrList);
             AlertDialog dialog = new AlertDialog.Builder(VideoPlayerActivity.this)
             .setTitle(R.string.track_audio)
-            .setSingleChoiceItems(arrList, (mLibVLC.getAudioTrack() - 1), new DialogInterface.OnClickListener() {
+            .setSingleChoiceItems(arrList, mLibVLC.getAudioTrack(), new DialogInterface.OnClickListener() {
                 @Override
                 public void onClick(DialogInterface dialog, int position) {
                     DatabaseManager.getInstance(VideoPlayerActivity.this).updateMedia(
                             mLocation,
                             DatabaseManager.mediaColumn.MEDIA_AUDIOTRACK,
-                            position + 1);
-                    mLibVLC.setAudioTrack(position + 1);
+                            position);
+                    mLibVLC.setAudioTrack(position);
                     dialog.dismiss();
                 }
             })



More information about the Android mailing list