From ae709b5c03100da86a44b5835080fd54bb5ce3e3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 24 Nov 2013 14:40:50 +0100 Subject: player: close demuxer before stream Demuxer might access stream even when closing. For now, this is not a real problem (because it didn't actually happen), but it's cleaner. --- mpvcore/player/loadfile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mpvcore/player/loadfile.c b/mpvcore/player/loadfile.c index 83916e5612..a913c25519 100644 --- a/mpvcore/player/loadfile.c +++ b/mpvcore/player/loadfile.c @@ -122,9 +122,10 @@ void uninit_player(struct MPContext *mpctx, unsigned int mask) for (int i = 0; i < mpctx->num_sources; i++) { uninit_subs(mpctx->sources[i]); struct demuxer *demuxer = mpctx->sources[i]; - if (demuxer->stream != mpctx->stream) - free_stream(demuxer->stream); + struct stream *stream = demuxer->stream; free_demuxer(demuxer); + if (stream != mpctx->stream) + free_stream(stream); } talloc_free(mpctx->sources); mpctx->sources = NULL; -- cgit v1.2.3