Skip to content

Commit b316856

Browse files
Copilotkangjoseph90
andcommitted
fix(audio): keep boosted clip seek synced with corrected timeline position
Co-authored-by: kangjoseph90 <83045825+kangjoseph90@users.noreply.github.com> Agent-Logs-Url: https://github.com/kangjoseph90/PictureBookBuilder/sessions/c88ad680-2c4b-4e46-9efc-7fb8a852ca88
1 parent ef3fe85 commit b316856

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/ui/audio_mixer.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,7 @@ def _start_clip(self, clip: ScheduledClip, current_position: float):
487487
# For boosted clips, source is the EXTRACTED segment (offset 0)
488488
# Time into clip determines position in temp file
489489
time_into_clip = current_position - clip.timeline_start
490-
clamped_position_ms = int(max(0.0, time_into_clip) * 1000)
491-
corrected_pos = int(clamped_position_ms * seek_correction)
490+
corrected_pos = int(max(0.0, time_into_clip * seek_correction) * 1000)
492491

493492
self._active_players[clip.clip_id] = (player, audio_output)
494493

@@ -503,9 +502,8 @@ def on_media_status_changed(status):
503502
player.setPlaybackRate(self._playback_rate)
504503
if self._playing:
505504
current_tic = self._position - clip.timeline_start
506-
clamped_playback_position_ms = int(max(0.0, current_tic) * 1000)
507-
corrected_playback_pos = int(clamped_playback_position_ms * seek_correction)
508-
player.setPosition(corrected_playback_pos)
505+
corrected_pos = int(max(0.0, current_tic * seek_correction) * 1000)
506+
player.setPosition(corrected_pos)
509507
player.play()
510508
else:
511509
player.setPosition(corrected_pos)

0 commit comments

Comments
 (0)