Commit 7d8d8905 authored by Edward Wang's avatar Edward Wang Committed by Jean-Baptiste Kempf

DirectoryViewFragment: fix item selection in a folder with subfolers

Should also fix many IndexOutOfBoundsExceptions

(cherry picked from commit 9cc7bce9)
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent b36d1340
......@@ -21,6 +21,7 @@
package org.videolan.vlc.gui;
import java.io.IOException;
import java.util.List;
import org.videolan.libvlc.LibVLC;
import org.videolan.vlc.AudioServiceController;
......@@ -172,7 +173,8 @@ public class DirectoryViewFragment extends SherlockListFragment implements ISort
try {
if (LibVLC.getExistingInstance() == null
|| !LibVLC.getExistingInstance().hasVideoTrack(mediaFile)) {
audioController.load(mDirectoryAdapter.getAllMediaLocations(), p-1); /* p-1 to exclude ".," */
List<String> mediaLocations = mDirectoryAdapter.getAllMediaLocations();
audioController.load(mediaLocations, mediaLocations.indexOf(mediaFile));
AudioPlayerActivity.start(getActivity());
} else {
VideoPlayerActivity.start(getActivity(), mediaFile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment