summaryrefslogtreecommitdiffstats
path: root/player/playloop.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-03 17:23:01 +0100
committerwm4 <wm4@nowhere>2015-01-03 17:23:01 +0100
commita7dddbacc6cc8cafb5aaf0cf7d8e36d2a759a6e9 (patch)
treed6760ddd04fc95429dafdfa2afa25f741bbe1edc /player/playloop.c
parent411109f484e7c8537540df414e92015d94a7ca98 (diff)
downloadmpv-a7dddbacc6cc8cafb5aaf0cf7d8e36d2a759a6e9.tar.bz2
mpv-a7dddbacc6cc8cafb5aaf0cf7d8e36d2a759a6e9.tar.xz
video: batch query_format calls
There are currently 568 pixel formats (actually fewer, but the namespace is this big), and for each format elaborate synchronization was done to call it synchronously on the VO. This is completely unnecessary, and we can do with just a single call.
Diffstat (limited to 'player/playloop.c')
-rw-r--r--player/playloop.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/player/playloop.c b/player/playloop.c
index 1a0f8fbdd5..fc55b9bf05 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -848,8 +848,10 @@ void handle_force_window(struct MPContext *mpctx, bool reconfig)
MP_INFO(mpctx, "Creating non-video VO window.\n");
// Pick whatever works
int config_format = 0;
+ uint8_t fmts[IMGFMT_END - IMGFMT_START] = {0};
+ vo_query_formats(vo, fmts);
for (int fmt = IMGFMT_START; fmt < IMGFMT_END; fmt++) {
- if (vo_query_format(vo, fmt)) {
+ if (fmts[fmt - IMGFMT_START]) {
config_format = fmt;
break;
}