From 1a8af89b7d09ad8a84410a3d8efe1a9f695cf9a7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 20 Aug 2016 14:11:35 +0200 Subject: [PATCH] vo: fix mismatching types in pointer operation run_control() dereferences an uint32_t as int. Whether this is allowed depends on what uint32_t is typedefed to (dereferencing an unsigned int as int should be fine). Fix it by always using int. The uint32_t type never really made sense. --- video/out/vo.c | 4 ++-- video/out/vo.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/video/out/vo.c b/video/out/vo.c index aa92d349e5..31eae5aef6 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -537,13 +537,13 @@ static void run_control(void *p) { void **pp = p; struct vo *vo = pp[0]; - uint32_t request = *(int *)pp[1]; + int request = *(int *)pp[1]; void *data = pp[2]; int ret = vo->driver->control(vo, request, data); *(int *)pp[3] = ret; } -int vo_control(struct vo *vo, uint32_t request, void *data) +int vo_control(struct vo *vo, int request, void *data) { int ret; void *p[] = {vo, &request, data, &ret}; diff --git a/video/out/vo.h b/video/out/vo.h index a5280e5611..8fdb2ed1e8 100644 --- a/video/out/vo.h +++ b/video/out/vo.h @@ -341,7 +341,7 @@ struct mpv_global; struct vo *init_best_video_out(struct mpv_global *global, struct vo_extra *ex); int vo_reconfig(struct vo *vo, struct mp_image_params *p); -int vo_control(struct vo *vo, uint32_t request, void *data); +int vo_control(struct vo *vo, int request, void *data); bool vo_is_ready_for_frame(struct vo *vo, int64_t next_pts); void vo_queue_frame(struct vo *vo, struct vo_frame *frame); void vo_wait_frame(struct vo *vo);