mirror of
https://github.com/mpv-player/mpv
synced 2024-07-31 16:29:58 +02:00
video/out: minor simplification to event query function
The "clear" parameter is confusing and useless.
This commit is contained in:
parent
b021d038c2
commit
3d7d1f3f26
@ -673,7 +673,7 @@ static void handle_cursor_autohide(struct MPContext *mpctx)
|
|||||||
static void handle_vo_events(struct MPContext *mpctx)
|
static void handle_vo_events(struct MPContext *mpctx)
|
||||||
{
|
{
|
||||||
struct vo *vo = mpctx->video_out;
|
struct vo *vo = mpctx->video_out;
|
||||||
int events = vo ? vo_query_events(vo, VO_EVENTS_USER, true) : 0;
|
int events = vo ? vo_query_and_reset_events(vo, VO_EVENTS_USER) : 0;
|
||||||
if (events & VO_EVENT_RESIZE)
|
if (events & VO_EVENT_RESIZE)
|
||||||
mp_notify(mpctx, MP_EVENT_WIN_RESIZE, NULL);
|
mp_notify(mpctx, MP_EVENT_WIN_RESIZE, NULL);
|
||||||
if (events & VO_EVENT_WIN_STATE)
|
if (events & VO_EVENT_WIN_STATE)
|
||||||
|
@ -840,7 +840,7 @@ int64_t vo_get_vsync_interval(struct vo *vo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set specific event flags, and wakeup the playback core if needed.
|
// Set specific event flags, and wakeup the playback core if needed.
|
||||||
// vo_query_events() can retrieve the events again.
|
// vo_query_and_reset_events() can retrieve the events again.
|
||||||
void vo_event(struct vo *vo, int event)
|
void vo_event(struct vo *vo, int event)
|
||||||
{
|
{
|
||||||
struct vo_internal *in = vo->in;
|
struct vo_internal *in = vo->in;
|
||||||
@ -852,14 +852,13 @@ void vo_event(struct vo *vo, int event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check event flags set with vo_event(). Return the mask of events that was
|
// Check event flags set with vo_event(). Return the mask of events that was
|
||||||
// set and included in the events parameter. If clear==true, clear these events.
|
// set and included in the events parameter. Clear the returned events.
|
||||||
int vo_query_events(struct vo *vo, int events, bool clear)
|
int vo_query_and_reset_events(struct vo *vo, int events)
|
||||||
{
|
{
|
||||||
struct vo_internal *in = vo->in;
|
struct vo_internal *in = vo->in;
|
||||||
pthread_mutex_lock(&in->lock);
|
pthread_mutex_lock(&in->lock);
|
||||||
int r = in->queued_events & events;
|
int r = in->queued_events & events;
|
||||||
if (clear)
|
in->queued_events &= ~(unsigned)r;
|
||||||
in->queued_events &= ~(unsigned)r;
|
|
||||||
pthread_mutex_unlock(&in->lock);
|
pthread_mutex_unlock(&in->lock);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -316,7 +316,7 @@ void vo_set_paused(struct vo *vo, bool paused);
|
|||||||
int64_t vo_get_drop_count(struct vo *vo);
|
int64_t vo_get_drop_count(struct vo *vo);
|
||||||
int vo_query_format(struct vo *vo, int format);
|
int vo_query_format(struct vo *vo, int format);
|
||||||
void vo_event(struct vo *vo, int event);
|
void vo_event(struct vo *vo, int event);
|
||||||
int vo_query_events(struct vo *vo, int events, bool clear);
|
int vo_query_and_reset_events(struct vo *vo, int events);
|
||||||
|
|
||||||
void vo_set_flip_queue_offset(struct vo *vo, int64_t us);
|
void vo_set_flip_queue_offset(struct vo *vo, int64_t us);
|
||||||
int64_t vo_get_vsync_interval(struct vo *vo);
|
int64_t vo_get_vsync_interval(struct vo *vo);
|
||||||
|
Loading…
Reference in New Issue
Block a user