diff options
author | Phi-Bang Nguyen <pnguyen@baylibre.com> | 2021-04-02 17:10:43 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-04-14 02:14:41 +0300 |
commit | 0373490ef64340ed42a21500b6f9a3575b890ba5 (patch) | |
tree | f74a8e6253c41026b8ca3a0c7ae8678cc419963f /src | |
parent | c8cfa6650d6f0f665ead2070e6f2767095331084 (diff) |
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: 4671911df040 ("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>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/pipeline/simple/simple.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 03d980c6..f6095d38 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -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. */ |