// If track was deallocated, skip it.
if (track.isAvailable())
continue;
Player player = track.getPlayer();
double eventSecs = track.getStartTime();
if (player.getStartLatency() != Controller.LATENCY_UNKNOWN) {
double latentSecs = player.getStartLatency().getSeconds();
// Subtract latency to move back syncStart call to
// accommodate it.
// If this value < 0, normalizeEventTime will adjust
eventSecs = eventSecs - latentSecs;
}
eventTime = (long)(eventSecs * 1000.0);
eventList[totalEventCount++] =
new MixerEvent(new StartCommand(player),
eventTime);
double playingTime = track.getPlayingTime();
// If user set playingTime longer than actual duration of
// media, force playingTime to actual duration.
playingTime = Math.min(playingTime,
player.getDuration().getSeconds());
// Just to be safe, only create StopCommand event if
// playing time > 0. Otherwise, let media run to EndOfMedia.
if (playingTime > 0) {