From 7ac89cd8f37ce9665c1701521b27a19d64223bed Mon Sep 17 00:00:00 2001 From: Todor Tomov Date: Tue, 25 Jan 2011 17:46:42 +0200 Subject: Modify media_entity_remote_pad() to return source pad only Rename media_entity_remote_pad() to media_entity_remote_source(). When it is called on a sink pad, return the linked source pad. When it is called on a source pad, return NULL. Signed-off-by: Todor Tomov --- media.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'media.c') diff --git a/media.c b/media.c index e976978..0ec5c16 100644 --- a/media.c +++ b/media.c @@ -37,19 +37,19 @@ /* * media_entity_remote_pad - */ -struct media_entity_pad *media_entity_remote_pad(struct media_entity_pad *pad) +struct media_entity_pad *media_entity_remote_source(struct media_entity_pad *pad) { unsigned int i; + if (!(pad->flags & MEDIA_PAD_FLAG_INPUT)) + return NULL; + for (i = 0; i < pad->entity->info.links; ++i) { struct media_entity_link *link = &pad->entity->links[i]; if (!(link->flags & MEDIA_LINK_FLAG_ACTIVE)) continue; - if (link->source == pad) - return link->sink; - if (link->sink == pad) return link->source; } -- cgit v1.2.3