From 23a9a40c33d284ee280b330b1ced9a7b6bcffd89 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 21 May 2010 00:45:48 +0200 Subject: Don't set formats on remote pads if the remote entity is not a subdev When setting format on an output pad, the same format is automatically set on the remote pads, if any. As the format setting API is subdev-specific, skip remote pads that belong to a non-subdev entity. Signed-off-by: Laurent Pinchart --- main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 40058fe..fad538d 100644 --- a/main.c +++ b/main.c @@ -300,7 +300,7 @@ static int setup_format(struct media_device *media, const char *p, char **endp) return ret; /* If the pad is an output pad, automatically set the same format on - * the remote inputs, if any. + * the remote subdev input pads, if any. */ if (pad->type == MEDIA_PAD_TYPE_OUTPUT) { for (i = 0; i < pad->entity->info.links; ++i) { @@ -310,7 +310,8 @@ static int setup_format(struct media_device *media, const char *p, char **endp) if (!(link->flags & MEDIA_LINK_FLAG_ACTIVE)) continue; - if (link->source == pad) { + if (link->source == pad && + link->sink->entity->info.type == MEDIA_ENTITY_TYPE_SUBDEV) { remote_format = format; set_format(link->sink, &remote_format); } -- cgit v1.2.3