summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mpvcore/player/loadfile.c5
1 files 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;