summaryrefslogtreecommitdiffstats
path: root/player/main.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-03 19:57:49 +0200
committerwm4 <wm4@nowhere>2014-10-03 23:05:09 +0200
commit9d5d031b6d23402a465618892a40b7af6d4e3c28 (patch)
tree143f43c4b002ec74f7172038e58409723647d892 /player/main.c
parent9570976255083c1ec32add62613c52ad98fa28c8 (diff)
downloadmpv-9d5d031b6d23402a465618892a40b7af6d4e3c28.tar.bz2
mpv-9d5d031b6d23402a465618892a40b7af6d4e3c28.tar.xz
player: remove central uninit_player() function and flags mess
Each subsystem (or similar thing) had an INITIALIZED_ flag assigned. The main use of this was that you could pass a bitmask of these flags to uninit_player(). Except in some situations where you wanted to uninitialize nearly everything, this wasn't really useful. Moreover, it was quite annoying that subsystems had most of the code in a specific file, but the uninit code in loadfile.c (because that's where uninit_player() was implemented). Simplify all this. Remove the flags; e.g. instead of testing for the INITIALIZED_AO flag, test whether mpctx->ao is set. Move uninit code to separate functions, e.g. uninit_audio_out().
Diffstat (limited to 'player/main.c')
-rw-r--r--player/main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/player/main.c b/player/main.c
index ff3b8ab7fe..2a05d3b4f4 100644
--- a/player/main.c
+++ b/player/main.c
@@ -118,8 +118,8 @@ static void shutdown_clients(struct MPContext *mpctx)
void mp_destroy(struct MPContext *mpctx)
{
- if (mpctx->initialized)
- uninit_player(mpctx, INITIALIZED_ALL);
+ uninit_audio_out(mpctx);
+ uninit_video_out(mpctx);
#if HAVE_ENCODING
encode_lavc_finish(mpctx->encode_lavc_ctx);
@@ -439,7 +439,6 @@ int mp_initialize(struct MPContext *mpctx)
return -1;
}
mpctx->mouse_cursor_visible = true;
- mpctx->initialized_flags |= INITIALIZED_VO;
}
// Lua user scripts (etc.) can call arbitrary functions. Load them at a point