Skip to content

Commit 2d2200c

Browse files
Copilotkangjoseph90
andcommitted
fix(audio): prevent boosted clip jump-ahead on media load callback
Co-authored-by: kangjoseph90 <83045825+kangjoseph90@users.noreply.github.com> Agent-Logs-Url: https://github.com/kangjoseph90/PictureBookBuilder/sessions/8cc21f7a-647b-4909-81d7-554a9fac6f42
1 parent b316856 commit 2d2200c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/ui/audio_mixer.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,11 @@ def on_media_status_changed(status):
501501
if status == QMediaPlayer.MediaStatus.LoadedMedia:
502502
player.setPlaybackRate(self._playback_rate)
503503
if self._playing:
504-
current_tic = self._position - clip.timeline_start
505-
corrected_pos = int(max(0.0, current_tic * seek_correction) * 1000)
504+
# Use the originally scheduled position instead of recalculating
505+
# from self._position. Boosted path can spend noticeable time in
506+
# ffmpeg extraction, and using current timeline position here can
507+
# skip into the clip unexpectedly when entering it.
508+
corrected_pos = int(max(0.0, time_into_clip * seek_correction) * 1000)
506509
player.setPosition(corrected_pos)
507510
player.play()
508511
else:

0 commit comments

Comments
 (0)