diff options
Diffstat (limited to 'player/core.h')
-rw-r--r-- | player/core.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/player/core.h b/player/core.h index 0434c5cb64..a42b1252b8 100644 --- a/player/core.h +++ b/player/core.h @@ -442,6 +442,8 @@ typedef struct MPContext { // --- The following fields are protected by abort_lock struct mp_cancel *demuxer_cancel; // cancel handle for MPContext.demuxer + struct mp_abort_entry **abort_list; + int num_abort_list; // --- Owned by MPContext pthread_t open_thread; @@ -459,6 +461,20 @@ typedef struct MPContext { int open_res_error; } MPContext; +// Contains information about an asynchronous work item, how it can be aborted, +// and when. All fields are protected by MPContext.abort_lock. +struct mp_abort_entry { + // General conditions. + bool coupled_to_playback; // trigger when playback is terminated + // Actual trigger to abort the work. + struct mp_cancel *cancel; + // For client API. + struct mpv_handle *client; // non-NULL if done by a client API user + int client_work_type; // client API type, e.h. MPV_EVENT_COMMAND_REPLY + uint64_t client_work_id; // client API user reply_userdata value + // (only valid if client_work_type set) +}; + // audio.c void reset_audio_state(struct MPContext *mpctx); void reinit_audio_chain(struct MPContext *mpctx); @@ -488,6 +504,12 @@ struct playlist_entry *mp_check_playlist_resume(struct MPContext *mpctx, // loadfile.c void mp_abort_playback_async(struct MPContext *mpctx); +void mp_abort_add(struct MPContext *mpctx, struct mp_abort_entry *abort); +void mp_abort_remove(struct MPContext *mpctx, struct mp_abort_entry *abort); +void mp_abort_recheck_locked(struct MPContext *mpctx, + struct mp_abort_entry *abort); +void mp_abort_trigger_locked(struct MPContext *mpctx, + struct mp_abort_entry *abort); void uninit_player(struct MPContext *mpctx, unsigned int mask); int mp_add_external_file(struct MPContext *mpctx, char *filename, enum stream_type filter); |