]> git.sesse.net Git - mlt/commit
Fix full closure of avformat on explicit close.
authorDan Dennedy <dan@dennedy.org>
Sun, 22 May 2011 18:30:32 +0000 (11:30 -0700)
committerDan Dennedy <dan@dennedy.org>
Sun, 22 May 2011 18:30:32 +0000 (11:30 -0700)
commitb416e89bdd072abf3c9276e69eee54f346da2dbf
treece17532025acdb39ff3ca10475ed965844672978
parentbff28276cabd6193529c98c4dd21ed824beaf525
Fix full closure of avformat on explicit close.

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.
src/modules/avformat/producer_avformat.c