~martijnbraam/megapixels

7314739dfc6d0628a35528eec1706d3760ffd662 — WebFreak001 1 year, 1 month ago ccbaaad
free cameras on process exit
1 files changed, 14 insertions(+), 0 deletions(-)

M src/io_pipeline.c
M src/io_pipeline.c => src/io_pipeline.c +14 -0
@@ 236,6 236,18 @@ setup(MPPipeline *pipeline, const void *data)
	mp_device_list_free(device_list);
}

static void
clean_cameras()
{
	for (size_t i = 0; i < MP_MAX_CAMERAS; ++i) {
		struct camera_info* info = &cameras[i];
		if (info->camera) {
			mp_camera_free(info->camera);
			info->camera = NULL;
		}
	}
}

void
mp_io_pipeline_start()
{


@@ 253,6 265,8 @@ mp_io_pipeline_stop()
		g_source_destroy(capture_source);
	}

	clean_cameras();

	mp_pipeline_free(pipeline);

	mp_process_pipeline_stop();