Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8323156

RealTimeSequencer.setTickPos handling of startTick wrong

XMLWordPrintable

      A DESCRIPTION OF THE PROBLEM :
      Implementation of RealTimeSequencer.setTickPos has several issues, which make the code not working as intended.

      - before calling `chaseEvents` oldLastTick is always set to `tickPos`, therefore it is always called as `chaseEvents(tickPos, tickPos)`. Most likely the intention was to call it as `chaseEvents(lastTick, tickPos)`
      - `chaseTrackEvents` processes all events from beginning, it ignores `startTick` other than checking `startTick > endTick`

      Note: the 2nd bug hides the first. One would expect `chaseEvents(lastTick, tickPos)` to do nothing, but it processes all events since start.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      There is probably no visible manifestation, only the function is slower than it could be. It might be possible to demonstrate performance degradation with some huge MIDI files.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      `setTickPos` should use `chaseEvents` only to process events between current position and new position, not all events sice start.
      ACTUAL -
      `setTickPos` / `chaseEvents` always processes all events since sequence start

      FREQUENCY : always


            pnarayanaswa Praveen Narayanaswamy
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: