summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
Diffstat (limited to 'video')
-rw-r--r--video/out/vo.c12
-rw-r--r--video/out/vo.h2
2 files changed, 8 insertions, 6 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index 82da6b5369..b7b017138d 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -782,15 +782,17 @@ static void run_query_format(void *p)
{
void **pp = p;
struct vo *vo = pp[0];
- *(int *)pp[2] = vo->driver->query_format(vo, *(int *)pp[1]);
+ uint8_t *list = pp[1];
+ for (int format = IMGFMT_START; format < IMGFMT_END; format++)
+ list[format - IMGFMT_START] = vo->driver->query_format(vo, format);
}
-int vo_query_format(struct vo *vo, int format)
+// For each item in the list (allocated as uint8_t[IMGFMT_END - IMGFMT_START]),
+// set the supported format flags.
+void vo_query_formats(struct vo *vo, uint8_t *list)
{
- int ret;
- void *p[] = {vo, &format, &ret};
+ void *p[] = {vo, list};
mp_dispatch_run(vo->in->dispatch, run_query_format, p);
- return ret;
}
// Calculate the appropriate source and destination rectangle to
diff --git a/video/out/vo.h b/video/out/vo.h
index 3d4d654738..383f47c7d7 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -319,7 +319,7 @@ void vo_seek_reset(struct vo *vo);
void vo_destroy(struct vo *vo);
void vo_set_paused(struct vo *vo, bool paused);
int64_t vo_get_drop_count(struct vo *vo);
-int vo_query_format(struct vo *vo, int format);
+void vo_query_formats(struct vo *vo, uint8_t *list);
void vo_event(struct vo *vo, int event);
int vo_query_and_reset_events(struct vo *vo, int events);