demux: parent chapter metadata to the chapter list

demux_disc replaces the chapter list at runtime. Parent each chapter's
tags to the list that contains them, so a replaced list keeps owning
its metadata instead of accumulating it on the demuxer.
This commit is contained in:
Kacper Michajłow committed 2026-08-26 01:47:41 +02:00
1 parent b0c4e8cab6
commit 47a53910a5
1 file changed
+1
+1
View File
@@ -4341,6 +4341,7 @@ int demuxer_add_chapter(demuxer_t *demuxer, char *name,
};
mp_tags_set_str(new.metadata, "TITLE", name);
MP_TARRAY_APPEND(demuxer, demuxer->chapters, demuxer->num_chapters, new);
talloc_steal(demuxer->chapters, new.metadata);
return demuxer->num_chapters - 1;
}