diff --git a/airtime_mvc/public/js/waveformplaylist/track.js b/airtime_mvc/public/js/waveformplaylist/track.js index edb221858..66f0ee644 100644 --- a/airtime_mvc/public/js/waveformplaylist/track.js +++ b/airtime_mvc/public/js/waveformplaylist/track.js @@ -192,6 +192,10 @@ TrackEditor.prototype.onTrackLoad = function(buffer) { if (this.cues === undefined) { this.setCuePoints(0, buffer.length - 1); } + //adjust if the length was inaccurate and cueout is set to a higher sample than we actually have. + else if (this.cues.cueout > (buffer.length - 1)) { + this.cues.cueout = buffer.length - 1; + } if (this.width !== undefined) { res = Math.ceil(buffer.length / this.width);