Commit ad366ab1 authored by Edward Wang's avatar Edward Wang
Browse files

AudioService: expand only when the media is fully parsed

Reduce unnecessary calls to LibVLC.expand(), since otherwise the subitems won't be available anyway.

This also fixes a bug where opening a playlist caused the contents to be imported twice due to extraneous expansion.
parent ac18965d
......@@ -466,7 +466,7 @@ public class AudioService extends Service {
Log.i(TAG, "MediaPlayerEndReached");
service.executeUpdate();
service.executeUpdateProgress();
service.determinePrevAndNextIndices();
service.determinePrevAndNextIndices(true);
service.next();
if (service.mWakeLock.isHeld())
service.mWakeLock.release();
......@@ -797,7 +797,11 @@ public class AudioService extends Service {
}
private void determinePrevAndNextIndices() {
mNextIndex = mLibVLC.expand();
determinePrevAndNextIndices(false);
}
private void determinePrevAndNextIndices(boolean expand) {
mNextIndex = expand ? mLibVLC.expand() : -1;
mPrevIndex = -1;
if (mNextIndex == -1) {
......
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