diff options
author | wm4 <wm4@nowhere> | 2018-05-12 16:51:53 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2018-05-24 19:56:34 +0200 |
commit | ce1f5e78c2b10e24c78d7ee65d7196093709b8ce (patch) | |
tree | 101b19e7372368e4f900234262a55d71380835c2 /player/loadfile.c | |
parent | 7f91e2684e8600c45512e36f03aadff0b825a1b0 (diff) | |
download | mpv-ce1f5e78c2b10e24c78d7ee65d7196093709b8ce.tar.bz2 mpv-ce1f5e78c2b10e24c78d7ee65d7196093709b8ce.tar.xz |
player: rename "lock" to "abort_lock"
If a struct as large as MPContext contains a field named "lock", it
creates the impression that it is the primary lock for MPContext. This
is wrong, the lock just protects a single field.
Diffstat (limited to 'player/loadfile.c')
-rw-r--r-- | player/loadfile.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/player/loadfile.c b/player/loadfile.c index 766f86a77b..e1864f3fd5 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -66,10 +66,10 @@ void mp_abort_playback_async(struct MPContext *mpctx) { mp_cancel_trigger(mpctx->playback_abort); - pthread_mutex_lock(&mpctx->lock); + pthread_mutex_lock(&mpctx->abort_lock); if (mpctx->demuxer_cancel) mp_cancel_trigger(mpctx->demuxer_cancel); - pthread_mutex_unlock(&mpctx->lock); + pthread_mutex_unlock(&mpctx->abort_lock); } static void uninit_demuxer(struct MPContext *mpctx) @@ -96,10 +96,10 @@ static void uninit_demuxer(struct MPContext *mpctx) free_demuxer_and_stream(mpctx->demuxer); mpctx->demuxer = NULL; - pthread_mutex_lock(&mpctx->lock); + pthread_mutex_lock(&mpctx->abort_lock); talloc_free(mpctx->demuxer_cancel); mpctx->demuxer_cancel = NULL; - pthread_mutex_unlock(&mpctx->lock); + pthread_mutex_unlock(&mpctx->abort_lock); } #define APPEND(s, ...) mp_snprintf_cat(s, sizeof(s), __VA_ARGS__) @@ -936,9 +936,9 @@ static void open_demux_reentrant(struct MPContext *mpctx) start_open(mpctx, url, mpctx->playing->stream_flags); // User abort should cancel the opener now. - pthread_mutex_lock(&mpctx->lock); + pthread_mutex_lock(&mpctx->abort_lock); mpctx->demuxer_cancel = mpctx->open_cancel; - pthread_mutex_unlock(&mpctx->lock); + pthread_mutex_unlock(&mpctx->abort_lock); while (!atomic_load(&mpctx->open_done)) { mp_idle(mpctx); @@ -954,9 +954,9 @@ static void open_demux_reentrant(struct MPContext *mpctx) mpctx->open_cancel = NULL; } else { mpctx->error_playing = mpctx->open_res_error; - pthread_mutex_lock(&mpctx->lock); + pthread_mutex_lock(&mpctx->abort_lock); mpctx->demuxer_cancel = NULL; - pthread_mutex_unlock(&mpctx->lock); + pthread_mutex_unlock(&mpctx->abort_lock); } cancel_open(mpctx); // cleanup |