diff options
author | wm4 <wm4@nowhere> | 2017-01-18 17:13:26 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-01-18 17:52:05 +0100 |
commit | c54c3b6991ac0273e6b7a42dc42c5103f87ff9f1 (patch) | |
tree | 1b543741e9bf171fa9a77fe90e4df9f62396284d /player/core.h | |
parent | 04858c0b83fd6c1fc60519c2034e263d2e7c3977 (diff) | |
download | mpv-c54c3b6991ac0273e6b7a42dc42c5103f87ff9f1.tar.bz2 mpv-c54c3b6991ac0273e6b7a42dc42c5103f87ff9f1.tar.xz |
player: restructure cancel callback
As preparation for file prefetching, we basically have to get rid of
using mpctx->playback_abort for the main demuxer (i.e. the thing that
can be prefetched). It can't be changed on a running demuxer, and always
using the same cancel handle would either mean aborting playback would
also abort prefetching, or that playback can't be aborted anymore.
Make this more flexible with some refactoring.
Thi is a quite shitty solution if you ask me, but YOLO.
Diffstat (limited to 'player/core.h')
-rw-r--r-- | player/core.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/player/core.h b/player/core.h index d7ff507524..ad61500741 100644 --- a/player/core.h +++ b/player/core.h @@ -430,6 +430,11 @@ typedef struct MPContext { struct mp_ipc_ctx *ipc_ctx; struct mpv_opengl_cb_context *gl_cb_ctx; + + pthread_mutex_t lock; + + // --- The following fields are protected by lock + struct mp_cancel *demuxer_cancel; // cancel handle for MPContext.demuxer } MPContext; // audio.c @@ -460,6 +465,7 @@ struct playlist_entry *mp_check_playlist_resume(struct MPContext *mpctx, struct playlist *playlist); // loadfile.c +void mp_abort_playback_async(struct MPContext *mpctx); void uninit_player(struct MPContext *mpctx, unsigned int mask); struct track *mp_add_external_file(struct MPContext *mpctx, char *filename, enum stream_type filter); |