diff options
Diffstat (limited to 'player/loadfile.c')
-rw-r--r-- | player/loadfile.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/player/loadfile.c b/player/loadfile.c index b4cc289360..9adf1fec87 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -650,8 +650,11 @@ bool mp_remove_track(struct MPContext *mpctx, struct track *track) for (int n = mpctx->num_tracks - 1; n >= 0 && !in_use; n--) in_use |= mpctx->tracks[n]->demuxer == d; - if (!in_use) - free_demuxer_and_stream(d); + if (!in_use) { + struct stream *s = d->stream; + free_demuxer(d); + free_stream(s); + } mp_notify(mpctx, MPV_EVENT_TRACKS_CHANGED, NULL); |