Prevent negative timeouts in player

This commit is contained in:
Albert Santoni 2015-04-29 11:59:17 -04:00
parent 9019377d0e
commit c0bd28f6d5
1 changed files with 6 additions and 0 deletions

View File

@ -273,6 +273,12 @@
}
}
});
//Preventative code if the local and remote clocks are out of sync.
if (time_to_next_track_starts < 0) {
time_to_next_track_starts = 0;
}
// Add 3 seconds to the timeout so Airtime has time to update the metadata before we fetch it
metadataTimer = setTimeout(attachStreamMetadataToPlayer, time_to_next_track_starts+3000);
}