History

demux_timeline: don't close segments during demuxing

add_tl() when creating virtual_stream list is referencing sh->codec which is owned by the demuxer. Don't close it to avoid dangling pointers. The comment is right, but this happens regardless of delay_open as we can clearly see in the add_tl() function.

Kacper Michajłow committed 1 year ago

Commit 91f80b51 parent 533a6841 file · +1 −3Browse files

Unified · Split

demux/demux_timeline.c+1−3
@@ -210,11 +210,9 @@ static void reopen_lazy_segments(struct demuxer *demuxer, · 209 unmodified lines
210210 if (src->current->d)
211211 return;
212212
213− // Note: in delay_open mode, we must _not_ close segments during demuxing,
213+ // Note: we must _not_ close segments during demuxing,
214214 // because demuxed packets have demux_packet.codec set to objects owned
215215 // by the segments. Closing them would create dangling pointers.
216− if (!src->delay_open)
217− close_lazy_segments(demuxer, src);
218216
219217 struct demuxer_params params = {
220218 .init_fragment = src->tl->init_fragment,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t