summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/main.c b/main.c
index c946f2d..c59b633 100644
--- a/main.c
+++ b/main.c
@@ -63,11 +63,10 @@ static struct media_entity_pad *parse_pad(struct media_device *media, const char
for (++end; isspace(*end); ++end);
} else {
- entity_id = strtoul(p, &end, 10) - 1;
- if (entity_id >= media->entities_count)
+ entity_id = strtoul(p, &end, 10);
+ entity = media_get_entity_by_id(media, entity_id);
+ if (entity == NULL)
return NULL;
-
- entity = &media->entities[entity_id];
}
if (*end != ':')