Skip to content
Snippets Groups Projects
Commit 8e1b480f authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Chapters and titles can be null

parent 0b4ef2cf
No related branches found
No related tags found
No related merge requests found
......@@ -364,7 +364,7 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
private void initChapters() {
final MediaPlayer.Chapter[] chapters = mService.getChapters(-1);
if (chapters == null) return;
int index = mService.getChapterIdx();
if (chapters[index].name == null || chapters[index].name.equals(""))
mChaptersTitle.setText(String.format("%s %d", getResources().getString(R.string.chapter), index));
......
......@@ -76,11 +76,9 @@ public class SelectChapterDialog extends DialogFragment implements PlaybackServi
private void initChapterList() {
final MediaPlayer.Chapter[] chapters = mService.getChapters(-1);
int chaptersCount = chapters != null ? chapters.length : 0;
if (chaptersCount <= 1) {
return;
}
if (chaptersCount <= 1) return;
List<Map<String, String>> chapterList = new ArrayList<Map<String, String>>();
final List<Map<String, String>> chapterList = new ArrayList<Map<String, String>>();
for (int i = 0; i < chaptersCount; i++) {
String name;
......
......@@ -218,9 +218,9 @@ class PlayerController : IVLCVout.Callback, MediaPlayer.EventListener {
fun navigate(where: Int) = mediaplayer.navigate(where)
fun getChapters(title: Int) = mediaplayer.getChapters(title)
fun getChapters(title: Int): Array<out MediaPlayer.Chapter>? = mediaplayer.getChapters(title)
fun getTitles() = mediaplayer.titles
fun getTitles(): Array<out MediaPlayer.Title>? = mediaplayer.titles
fun getChapterIdx() = mediaplayer.chapter
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment