diff --git a/spa/plugins/libcamera/libcamera-utils.c b/spa/plugins/libcamera/libcamera-utils.c index 4a57c6774..87be87e91 100644 --- a/spa/plugins/libcamera/libcamera-utils.c +++ b/spa/plugins/libcamera/libcamera-utils.c @@ -912,6 +912,10 @@ static int spa_libcamera_stream_off(struct impl *this) libcamera_stop_capture(dev->camera); + spa_log_info(this->log, "disconnecting camera"); + + libcamera_disconnect(dev->camera); + spa_loop_invoke(this->data_loop, do_remove_source, 0, NULL, 0, true, port); spa_list_init(&port->queue); diff --git a/spa/plugins/libcamera/libcamera_wrapper.cpp b/spa/plugins/libcamera/libcamera_wrapper.cpp index 4e0a461c8..dfc224812 100644 --- a/spa/plugins/libcamera/libcamera_wrapper.cpp +++ b/spa/plugins/libcamera/libcamera_wrapper.cpp @@ -518,8 +518,6 @@ extern "C" { } void LibCamera::stop() { - this->disconnect(); - StreamConfiguration &cfg = this->config_->at(0); Stream *stream = cfg.stream(); uint32_t nbuffers = this->allocator_->buffers(stream).size();