libcamera: pipeline_handler: Fix unlocking media devices too early
PipelineHandler::acquire() only locks the media devices when the first camera is acquired. If a second camera of a pipeline is acquired only useCount_ is increased and nothing else is done. When releasing cameras PipelineHandler::release() should only unlock the media devices when the last camera is released. But the old code unlocked on every release(). Fix PipelineHandler::release() to only release the media devices when the last camera is released. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Harvey Yang <chenghaoyang@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
fc7250f0b3
commit
a3fb0b3d0a
1 changed files with 2 additions and 1 deletions
|
@ -205,6 +205,7 @@ void PipelineHandler::release(Camera *camera)
|
|||
|
||||
ASSERT(useCount_);
|
||||
|
||||
if (useCount_ == 1)
|
||||
unlockMediaDevices();
|
||||
|
||||
releaseDevice(camera);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue