diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-06-14 22:57:45 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-06-14 22:57:45 +0200 |
commit | 0c4da2bb2f4d7d3cd2cdea1369374d5b4f7e3b29 (patch) | |
tree | a55b8de0b6c5271062733cb0377732487918ac44 /main.c | |
parent | 25ed35b7c2705f53471118437a538bc9a60701be (diff) |
Enumerate entities using MEDIA_ENTITY_ID_FLAG_NEXT
Entity IDs don't have to be contiguous. Use the new flag-based
enumeration system instead of looping over consecutive IDs.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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 != ':') |