Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird code in Sequence #58

Open
ronkorving opened this issue May 19, 2017 · 2 comments
Open

Weird code in Sequence #58

ronkorving opened this issue May 19, 2017 · 2 comments

Comments

@ronkorving
Copy link

ronkorving commented May 19, 2017

Inside the Sequence.prototype._reconstruct method, there is a weird piece of code. link

if (activePlayableHandle !== null) {
  // Determining where to set the sequence's starting time so that the local time within
  // the active playable remains the same
  var currentStartTime = this._getStartTime();
  var timeInActiveAfter = this._time - activePlayable._getStartTime();
  var shift = timeInActiveBefore - timeInActiveAfter;
  this._startTime += shift;
}

Note how currentStartTime is being set by this._getStartTime() and then never gets used. "Instead" (or maybe they have no relation and I'm missing the point), on the next line activePlayable._getStartTime() is used.

One of two things seem to be true:

  • var currentStartTime = this._getStartTime(); can be removed, behavior remains equal.
  • activePlayable._getStartTime() should be replaced with currentStartTime, changing the behavior.

I have no idea which, but something's up here, and deserves attention.

@bchevalier
Copy link
Contributor

I think it used to be

this._startTime = currentStartTime  + shift;

but because this._getStartTime() returns this._startTime it could be simplified and currentStartTime was not removed.

The global problem here is that TINA needs a linter

@ronkorving
Copy link
Author

It seems there is a linter. But is it used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants