Browse Source

Fix optional, enabled links not being reset properly

Kristian Vos 1 year ago
parent
commit
3d8ff4ea64
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/pipeline.c

+ 4 - 1
src/pipeline.c

@@ -102,15 +102,18 @@ load_entity_ids(libmegapixels_camera *camera)
 	for (int i = 0; i < topology.num_links; i++) {
 		if (links[i].flags & MEDIA_LNK_FL_ENABLED && !(links[i].flags & MEDIA_LNK_FL_IMMUTABLE)) {
 			uint32_t source_entity = 0, sink_entity = 0;
+			uint16_t source_index = 0, sink_index = 0;
 			for (int j = 0; j < topology.num_pads; j++) {
 				if (pads[j].id == links[i].source_id) {
 					source_entity = pads[j].entity_id;
+					source_index = pads[j].index;
 				} else if (pads[j].id == links[i].sink_id) {
 					sink_entity = pads[j].entity_id;
+					sink_index = pads[j].index;
 				}
 			}
 
-			setup_link(camera, source_entity, sink_entity, 0, 0, 0);
+			setup_link(camera, source_entity, sink_entity, source_index, sink_index, 0);
 		}
 	}
 	return 0;