summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-24 14:40:50 +0100
committerwm4 <wm4@nowhere>2013-11-24 14:44:58 +0100
commitae709b5c03100da86a44b5835080fd54bb5ce3e3 (patch)
tree149b2303ec4c82dc1e3ecc3ec7ed3a6c79310da9
parent4012c4a96ee1786bb0d17bd2a3368d20fbb870c9 (diff)
downloadmpv-ae709b5c03100da86a44b5835080fd54bb5ce3e3.tar.bz2
mpv-ae709b5c03100da86a44b5835080fd54bb5ce3e3.tar.xz
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.
-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;