mirror of
https://github.com/mpv-player/mpv
synced 2025-02-27 19:01:07 +00:00
demux_edl: fix assertion failure on exit in obscure ytdl cases
If a DASH-hack EDL has an init fragment is set, it opens the init fragment as such to get the track layout (including codec etc.) and avoids opening actual fragments until actual playback. It does not get added to the source array, so it leaks on exit, which triggers an obscure (but very justified) assertion in thread_tools.c:106. Fix the leak by adding the additional demuxer instance to the sources arrays, which gets it freed. This is a regression from when I rewrote some of the timeline handling. I decided that in order to make memory management slightly simpler, freeing a timeline should only free elements in the sources array. That is OK; I just didn't re-test with pseudo-DASH that has init fragments, and just hit a video that uses that by accidents. These videos are rather scarce (apparently) so it happened only now. The real solution would probably be adding demuxer reference counting. This EDL memory management is just too messy, and throwing refcounting at such problems is an effective and popular fix. Then you'd get debugging nightmares with incorrect refcounts too, though.
This commit is contained in:
parent
a52ab8dc30
commit
5901c3ae0d
@ -282,6 +282,7 @@ static struct timeline_par *build_timeline(struct timeline *root,
|
|||||||
MP_ERR(root, "Could not demux init fragment.\n");
|
MP_ERR(root, "Could not demux init fragment.\n");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
MP_TARRAY_APPEND(root, root->sources, root->num_sources, tl->track_layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
tl->parts = talloc_array_ptrtype(tl, tl->parts, parts->num_parts);
|
tl->parts = talloc_array_ptrtype(tl, tl->parts, parts->num_parts);
|
||||||
|
Loading…
Reference in New Issue
Block a user