diff options
author | wm4 <wm4@nowhere> | 2017-01-22 15:23:35 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-01-22 15:24:13 +0100 |
commit | 5c942128d80b358e53239d56d90cb1b3189a1243 (patch) | |
tree | 66e428b8dcebe5587fc6f15e37f0315d008b5c66 /player | |
parent | 06c55ac6c32a21419cfc55bbb773e922816991fe (diff) | |
download | mpv-5c942128d80b358e53239d56d90cb1b3189a1243.tar.bz2 mpv-5c942128d80b358e53239d56d90cb1b3189a1243.tar.xz |
player: actually initialize/destroy MPContext.lock
Seems like quite on oversight.
For most of the better pthread implementations, pthread_mutex_init() on
an already 0-initialized memory block is probably a no-op, but of course
we should do things correctly. Also could setup analysis tools.
Diffstat (limited to 'player')
-rw-r--r-- | player/main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/player/main.c b/player/main.c index 8f54b98728..87ec1ab70b 100644 --- a/player/main.c +++ b/player/main.c @@ -199,6 +199,7 @@ void mp_destroy(struct MPContext *mpctx) pthread_detach(pthread_self()); mp_msg_uninit(mpctx->global); + pthread_mutex_destroy(&mpctx->lock); talloc_free(mpctx); } @@ -335,6 +336,8 @@ struct MPContext *mp_create(void) .playback_abort = mp_cancel_new(mpctx), }; + pthread_mutex_init(&mpctx->lock, NULL); + mpctx->global = talloc_zero(mpctx, struct mpv_global); // Nothing must call mp_msg*() and related before this |