CC-5379: adding a file after a gap in now playing - starts too early

Fixed the start time in cc_schedule
Track still starts playing later than cue in (CC-5019)
This commit is contained in:
denise 2013-10-10 12:11:23 -04:00
parent 533fbeb5f6
commit c85833239c
1 changed files with 7 additions and 5 deletions

View File

@ -19,6 +19,7 @@ class Application_Model_Scheduler
private $user; private $user;
private $crossfadeDuration; private $crossfadeDuration;
private $applyCrossfades = true;
private $checkUserPermissions = true; private $checkUserPermissions = true;
@ -400,6 +401,7 @@ class Application_Model_Scheduler
//check for if the show has started. //check for if the show has started.
if (bccomp( $nEpoch , $sEpoch , 6) === 1) { if (bccomp( $nEpoch , $sEpoch , 6) === 1) {
$this->applyCrossfades = false;
//need some kind of placeholder for cc_schedule. //need some kind of placeholder for cc_schedule.
//playout_status will be -1. //playout_status will be -1.
$nextDT = $this->nowDT; $nextDT = $this->nowDT;
@ -618,7 +620,7 @@ class Application_Model_Scheduler
/* Show is not empty so we need to apply crossfades /* Show is not empty so we need to apply crossfades
* for the first inserted item * for the first inserted item
*/ */
$applyCrossfades = true; //$applyCrossfades = true;
} }
//selected empty row to add after //selected empty row to add after
else { else {
@ -631,7 +633,7 @@ class Application_Model_Scheduler
/* Show is empty so we don't need to calculate crossfades /* Show is empty so we don't need to calculate crossfades
* for the first inserted item * for the first inserted item
*/ */
$applyCrossfades = false; $this->applyCrossfades = false;
} }
if (!in_array($instanceId, $affectedShowInstances)) { if (!in_array($instanceId, $affectedShowInstances)) {
@ -646,7 +648,7 @@ class Application_Model_Scheduler
$pstart = microtime(true); $pstart = microtime(true);
if ($applyCrossfades) { if ($this->applyCrossfades) {
$initalStartDT = clone $this->findTimeDifference( $initalStartDT = clone $this->findTimeDifference(
$nextStartDT, $this->crossfadeDuration); $nextStartDT, $this->crossfadeDuration);
} else { } else {
@ -730,7 +732,7 @@ class Application_Model_Scheduler
default: break; default: break;
} }
if ($applyCrossfades) { if ($this->applyCrossfades) {
$nextStartDT = $this->findTimeDifference($nextStartDT, $nextStartDT = $this->findTimeDifference($nextStartDT,
$this->crossfadeDuration); $this->crossfadeDuration);
$endTimeDT = $this->findEndTime($nextStartDT, $file['cliplength']); $endTimeDT = $this->findEndTime($nextStartDT, $file['cliplength']);
@ -738,7 +740,7 @@ class Application_Model_Scheduler
/* Set it to false because the rest of the crossfades /* Set it to false because the rest of the crossfades
* will be applied after we insert each item * will be applied after we insert each item
*/ */
$applyCrossfades = false; $this->applyCrossfades = false;
} }
$endTimeDT = $this->findEndTime($nextStartDT, $file['cliplength']); $endTimeDT = $this->findEndTime($nextStartDT, $file['cliplength']);