pipeline: simple: Fix an issue in breadth-first search
When seting up the pipeline, the latest entity in the queue is
taken but the oldest one is poped. This is a mistake. Fix it.
Fixes: 4671911df0 ("pipeline: simple: Use breadth-first search to setup media pipeline")
Signed-off-by: Phi-Bang Nguyen <pnguyen@baylibre.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
committed by
Laurent Pinchart
parent
c8cfa6650d
commit
0373490ef6
@@ -287,12 +287,12 @@ SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,
|
||||
|
||||
/* Remember at each entity where we came from. */
|
||||
std::unordered_map<MediaEntity *, Entity> parents;
|
||||
queue.push(sensor);
|
||||
|
||||
MediaEntity *entity = nullptr;
|
||||
|
||||
queue.push(sensor);
|
||||
|
||||
while (!queue.empty()) {
|
||||
entity = queue.back();
|
||||
entity = queue.front();
|
||||
queue.pop();
|
||||
|
||||
/* Found the capture device. */
|
||||
|
||||
Reference in New Issue
Block a user