From 6c1355be967751b194504ed73b053846fbae5fa9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 20 Feb 2015 21:08:10 +0100 Subject: demux: add free_demuxer_and_stream() function Although their lifetimes are conceptually different, it happens often that a demuxer is destroyed together with its stream. --- demux/timeline.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'demux/timeline.c') diff --git a/demux/timeline.c b/demux/timeline.c index 6274c25fa3..9910abf46d 100644 --- a/demux/timeline.c +++ b/demux/timeline.c @@ -32,11 +32,8 @@ void timeline_destroy(struct timeline *tl) return; for (int n = 0; n < tl->num_sources; n++) { struct demuxer *d = tl->sources[n]; - if (d != tl->demuxer) { - struct stream *s = d->stream; - free_demuxer(d); - free_stream(s); - } + if (d != tl->demuxer) + free_demuxer_and_stream(d); } talloc_free(tl); } -- cgit v1.2.3