From 9d5d031b6d23402a465618892a40b7af6d4e3c28 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 3 Oct 2014 19:57:49 +0200 Subject: 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(). --- player/command.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'player/command.c') diff --git a/player/command.c b/player/command.c index 9818385abc..8d4e3170a9 100644 --- a/player/command.c +++ b/player/command.c @@ -1686,10 +1686,10 @@ static int mp_property_hwdec(void *ctx, struct m_property *prop, int new = *(int *)arg; if (current == new) return M_PROPERTY_OK; - if (!(mpctx->initialized_flags & INITIALIZED_VCODEC)) + if (!mpctx->d_video) return M_PROPERTY_ERROR; double last_pts = mpctx->last_vo_pts; - uninit_player(mpctx, INITIALIZED_VCODEC); + uninit_video_chain(mpctx); opts->hwdec_api = new; reinit_video_chain(mpctx); if (last_pts != MP_NOPTS_VALUE) -- cgit v1.2.3