From 0f9bcd8d0a4f36699efec96cc907833ace97600e Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Thu, 23 Mar 2017 18:44:43 +0100 Subject: video: check if any video-source modules are loaded --- src/video.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/video.c b/src/video.c index 6af81a9..a7eb97a 100644 --- a/src/video.c +++ b/src/video.c @@ -955,14 +955,19 @@ int video_start(struct video *v, const char *peer) info("video: no video display\n"); } - size.w = v->cfg.width; - size.h = v->cfg.height; - err = set_encoder_format(&v->vtx, v->cfg.src_mod, - v->vtx.device, &size); - if (err) { - warning("video: could not set encoder format to" - " [%u x %u] %m\n", - size.w, size.h, err); + if (vidsrc_find(NULL)) { + size.w = v->cfg.width; + size.h = v->cfg.height; + err = set_encoder_format(&v->vtx, v->cfg.src_mod, + v->vtx.device, &size); + if (err) { + warning("video: could not set encoder format to" + " [%u x %u] %m\n", + size.w, size.h, err); + } + } + else { + info("video: no video source\n"); } tmr_start(&v->tmr, TMR_INTERVAL * 1000, tmr_handler, v); -- cgit v1.2.3