JBM wrote:
Creating a video4linux producer like (simplified code):
producer = new Mlt::Producer(*profile, "video4linux2:/dev/video0");
consumer->connect(*producer);
consumer->start();
It works fine. But when I want to stop the capture, there is no way to
stop the video4linux producer. Deleting the producer and the consumer
still leaves the video4linux device open.
After a few hours of struggling, I figured out that some stuff was kept
in the cache. Adding :
mlt_service_cache_purge( MLT_PRODUCER_SERVICE(parent) );
to producer_close (as already done for the qimage producer for example)
fixes the issue.
static void producer_close( mlt_producer parent )
{
+ // Remove this instance from the cache
+ mlt_service_cache_purge( MLT_PRODUCER_SERVICE(parent) );
+
// Close the parent
parent->close = NULL;
mlt_producer_close( parent );