summaryrefslogtreecommitdiffstats
path: root/video/out/vo.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-19 18:37:16 +0100
committerwm4 <wm4@nowhere>2014-12-19 18:54:39 +0100
commit88982f2855590cafb1fdce916384751ae728ba0c (patch)
treefbc954496ac649aef5f253f33002010f9a30086f /video/out/vo.c
parentbebc323c6d6aab298f920cd462e7c0fe375925db (diff)
downloadmpv-88982f2855590cafb1fdce916384751ae728ba0c.tar.bz2
mpv-88982f2855590cafb1fdce916384751ae728ba0c.tar.xz
vo_opengl: better probe handling
Involve detection of software renderers in the probing properly. Other VOs could handle probing also more gracefully, and e.g. produce less noise if an API is unavailable. (Although other than the OpenGL VOs, only vo_wayland will.) Now the "sw" suboption for vo_opengl[_old] is strictly speaking not needed anymore. Doing "--vo=opengl" disables the probing logic, and will always force it, if possible. Includes some simplifications as well.
Diffstat (limited to 'video/out/vo.c')
-rw-r--r--video/out/vo.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index f6dda92532..c2ec6c5813 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -202,7 +202,7 @@ static void dealloc_vo(struct vo *vo)
talloc_free(vo);
}
-static struct vo *vo_create(struct mpv_global *global,
+static struct vo *vo_create(bool probing, struct mpv_global *global,
struct input_ctx *input_ctx, struct osd_state *osd,
struct encode_lavc_context *encode_lavc_ctx,
char *name, char **args)
@@ -225,6 +225,7 @@ static struct vo *vo_create(struct mpv_global *global,
.osd = osd,
.event_fd = -1,
.monitor_par = 1,
+ .probing = probing,
.in = talloc(vo, struct vo_internal),
};
talloc_steal(vo, log);
@@ -271,7 +272,8 @@ struct vo *init_best_video_out(struct mpv_global *global,
// Something like "-vo name," allows fallback to autoprobing.
if (strlen(vo_list[n].name) == 0)
goto autoprobe;
- struct vo *vo = vo_create(global, input_ctx, osd, encode_lavc_ctx,
+ bool p = !!vo_list[n + 1].name;
+ struct vo *vo = vo_create(p, global, input_ctx, osd, encode_lavc_ctx,
vo_list[n].name, vo_list[n].attribs);
if (vo)
return vo;
@@ -281,7 +283,7 @@ struct vo *init_best_video_out(struct mpv_global *global,
autoprobe:
// now try the rest...
for (int i = 0; video_out_drivers[i]; i++) {
- struct vo *vo = vo_create(global, input_ctx, osd, encode_lavc_ctx,
+ struct vo *vo = vo_create(true, global, input_ctx, osd, encode_lavc_ctx,
(char *)video_out_drivers[i]->name, NULL);
if (vo)
return vo;