Skip to content

Conversation

@Taym95
Copy link
Member

@Taym95 Taym95 commented Dec 5, 2025

Fixes: servo/servo#41073

Previously:
the moment we set bufferSource.loop = true, the node hit the early “extreme edge case” check, decided “I refuse to output”, triggered onended, and returned silence. So the loop never got a chance to run.

Now:

  • Early bailout is removed(no idea why was there in first place).
  • The per tick offset is guaranteed to be a sensible value with respect to the loop range (wrapped if extreme).
  • The normal mixing code runs, updating pos each tick and respecting the loop region.

@Taym95 Taym95 force-pushed the fix-bufferSource-loop branch from 2e616cd to 21bf1f3 Compare December 5, 2025 14:26
@Taym95 Taym95 marked this pull request as draft December 5, 2025 14:46
@Taym95 Taym95 force-pushed the fix-bufferSource-loop branch 5 times, most recently from be31429 to a0f2e9f Compare December 5, 2025 14:54
@Taym95 Taym95 changed the title Fix bufferSource loop Fix bufferSource.loop = true on extreme edge case Dec 9, 2025
@Taym95 Taym95 force-pushed the fix-bufferSource-loop branch from a0f2e9f to 0c43685 Compare December 9, 2025 01:12
@Taym95 Taym95 marked this pull request as ready for review December 9, 2025 01:57
@Taym95 Taym95 requested a review from jdm December 9, 2025 01:58
Copy link
Member

@jdm jdm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! Thanks!

Signed-off-by: Taym Haddadi <[email protected]>
@Taym95 Taym95 enabled auto-merge December 9, 2025 09:39
@Taym95 Taym95 added this pull request to the merge queue Dec 9, 2025
Merged via the queue into servo:main with commit e55a9c6 Dec 9, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WebAudio: looping audio using bufferSource.loop doesn't work

2 participants