Skip to content

Conversation

@christoph-heinrich
Copy link
Contributor

Sometimes when opening a YouTube video with chapters, the chapter-list ended up having all the chapters twice, despite the json from yt-dlp only containing them once. That must mean that sometimes add_single_video() runs twice before the chapter_list table gets cleared in the on_preloaded hook.

This can be avoided by replacing chapter_list with a new table before adding entries to it.

I don't understand why add_single_video() sometimes runs twice before the table gets cleared in on_preloaded, and it happens so rarely that I can't really debug it, but this change should at least prevent the problem with the chapters.

Sometimes when opening a YouTube video with chapters, the chapter-list
ended up having all the chapters twice, despite the json from yt-dlp only
containing them once. That must mean that sometimes add_single_video()
runs twice before the chapter_list table gets cleared in the
on_preloaded hook.

This can be avoided by replacing chapter_list with a new table before
adding entries to it.
@github-actions
Copy link

Download the artifacts for this pull request:

Windows
macOS

@kasper93
Copy link
Member

Should be safe fix for release.

@kasper93 kasper93 merged commit 958fee6 into mpv-player:master Mar 23, 2025
39 of 41 checks passed
@christoph-heinrich christoph-heinrich deleted the prevent_double_chapters branch March 23, 2025 23:41
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.

2 participants