SRGSSR / srgmediaplayer-apple

An advanced media player library, simple and reliable
MIT License
158 stars 33 forks source link

Slow playback rate change not immediately applied after having moved away from the live edge #117

Closed defagos closed 2 years ago

defagos commented 2 years ago

After having moved away from the live edge changing the playback rate to a value < 1 should be immediate (unlike values > 1 for which the current value needs to be preserved in some area near the live edge).

Issue type

Incorrect behavior

Environment information

Reproducibility

Always reproducible

Steps to reproduce

  1. Open the demo project.
  2. Play Livestream with DVR sample using the advanced custom player.
  3. Seek 15 seconds in the past.
  4. Change the playback rate to 0.5x. The rate is said to be limited to 1x though this is unnecessary, either briefly or for a longer while. The effective playback rate incorrectly stays at 1x while the message is displayed.
defagos commented 2 years ago

We were already testing playback rate stability, but not in the case described above (starting at the edge with rate 1x, moving a bit in the past, then changing to another rate).

I added two corresponding test cases for slow and fast playback speeds and improved the implementation so that they both pass. This fixes the above reported issue.

Available for review on feature/playback-speed-fix.