Fixed play button sticking for certain songs on start due to waiting for duration availability.
This commit is contained in:
parent
8b3bc16f52
commit
ea23faa16c
@ -45,7 +45,7 @@ final class LibraryUtils {
|
||||
});
|
||||
if(callbacksEnabled)
|
||||
callbackInterface.libraryUpdated(true);
|
||||
});
|
||||
}, "libraryUpdater");
|
||||
updaterThread.start();
|
||||
}
|
||||
|
||||
|
@ -68,12 +68,12 @@ class Player {
|
||||
}
|
||||
playBin.setURI(songFile.toURI());
|
||||
internalThread = new InternalThread();
|
||||
thread = new Thread(internalThread);
|
||||
thread = new Thread(internalThread, "GSTThread");
|
||||
setVolume(currentVolume);
|
||||
playBin.play();
|
||||
thread.start();
|
||||
while (true) {
|
||||
if (playBin.queryDuration().getNanoSeconds() > 0) break;
|
||||
if (playBin.queryDuration().getSeconds() > 0 || playBin.queryDuration().getNanoSeconds() > 0) break;
|
||||
} // Wait for song to actually be playing otherwise queryDuration is always zero
|
||||
callbackInterface.setSeekBarDuration((int) playBin.queryDuration().toSeconds());
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class PlayerGUI implements PlayerCallbackInterface, LibraryCallbackInterf
|
||||
running = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
}, "seekbar");
|
||||
seekBarUpdater.start();
|
||||
refreshLibrary();
|
||||
}
|
||||
@ -202,7 +202,7 @@ public class PlayerGUI implements PlayerCallbackInterface, LibraryCallbackInterf
|
||||
addNodeToTreeModel(failedModel, failedParentNode, failedNode);
|
||||
libraryView.setModel(failedModel);
|
||||
}
|
||||
});
|
||||
}, "libraryRefresh");
|
||||
populateThread.start();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user