summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--media.c8
-rw-r--r--media.h2
2 files changed, 5 insertions, 5 deletions
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;
}
diff --git a/media.h b/media.h
index 9467cdc..c94e60e 100644
--- a/media.h
+++ b/media.h
@@ -52,7 +52,7 @@ struct media_device {
struct media_device *media_open(const char *name, int verbose);
void media_close(struct media_device *media);
-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);
static inline unsigned int media_entity_type(struct media_entity *entity)
{