Skip to content

Adjust the audio playback for the changed animation framerate

Maciej Jesionowski requested to merge yavn/krita:anim-audio-fps-fix into master

This is a basic fix to avoid the audio getting cut short if the FPS was increased. Once we increase the framerate, the animation will use more frames, so the audio track must span more frames as well to still play in full.

Maybe this can be done more optimally, just offering an example fix.

Related KA post: https://krita-artists.org/t/testers-wanted-5-2-3-beta1-issues-and-feedback-thread/93122/62?u=yrh

This bug affects master, 5.2.3 and 5.2.2 (live).

Test Plan

  1. Start Krita
  2. Create a new document, open the animation timeline
  3. Modify the animation settings:
    start frame 0
    end frame 1000 (just sufficiently large)
    FPS 10
  4. Add an audio file. In my case it was a WAV file with 27 seconds length.
  5. Play back the animation. It will play normally and the audio will end at around 270’th frame. (everything works as expected until this point)
  6. Modify the animation settings again, and change the FPS to 20
  7. Play back the animation. The audio will stop at the same frame, but now due to the FPS being twice as large as before, it will be cut off in half before finishing (i.e. only 13.5 seconds of 27 seconds clip will play).
  8. (BONUS) Remove the audio clip. Add back the same audio clip. Now it play in full at 20 FPS.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
  • Does the patch add a user-visible feature? If yes, is there a documentation MR ready for it at Krita Documentation Repository?

Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build. If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.

Edited by Maciej Jesionowski

Merge request reports