Hi,
during debugging a program that uses mlt i found a lot of leaks in mlt
framework.
i prepared very small program that opens producer only (see attached)
running valgrind
valgrind -v --leak-check=full --error-limit=no --leak-resolution=high
--show-reachable=yes ./mlt_play
reports tons of errors, and among them:
[...]
==8838== 40 bytes in 1 blocks are definitely lost in loss record 2 of 19
==8838== at 0x4A074CD: malloc (vg_replace_malloc.c:236)
==8838== by 0xC0B8654: ???
==8838== by 0xCA5E29F: ???
==8838== by 0xC0B8209: ???
==8838== by 0xC0B8576: ???
==8838== by 0x4C48439: mlt_factory_producer (mlt_factory.c:291)
==8838== by 0xB67FB31: ???
==8838== by 0xB67FE33: ???
==8838== by 0x4C48439: mlt_factory_producer (mlt_factory.c:291)
==8838== by 0x4007C4: main (mlt_play.c:11)
==8838==
==8838== 40 bytes in 1 blocks are definitely lost in loss record 3 of 19
==8838== at 0x4A074CD: malloc (vg_replace_malloc.c:236)
==8838== by 0xC0B8654: ???
==8838== by 0xCA5E2B2: ???
==8838== by 0xC0B8209: ???
==8838== by 0xC0B8576: ???
==8838== by 0x4C48439: mlt_factory_producer (mlt_factory.c:291)
==8838== by 0xB67FB31: ???
==8838== by 0xB67FE33: ???
==8838== by 0x4C48439: mlt_factory_producer (mlt_factory.c:291)
==8838== by 0x4007C4: main (mlt_play.c:11)
==8838==
[...]
is it a bug or i forget to free some resources?
--
________________________________________
Maksym Veremeyenko
#include <stdio.h>
#include <unistd.h>
#include <framework/mlt.h>
/* comment next line to test mem leak for real playback */
#define MINIMAL
/* comment next line to test mem leak on error */
#define FILE_EXISTING "/tmp/probe5.mov"
#ifdef FILE_EXISTING
#define FILE_TO_USE FILE_EXISTING
#else
#define FILE_TO_USE "/tmp/blabla.mov"
#endif
int main( int argc, char *argv[] )
{
mlt_repository repo = mlt_factory_init(NULL);
mlt_profile profile = mlt_profile_init("dv_pal");
mlt_producer producer = mlt_factory_producer(profile, NULL, FILE_TO_USE);
#ifndef MINIMAL
mlt_consumer consumer = mlt_factory_consumer(profile, "decklink", "0");
mlt_playlist playlist = mlt_playlist_init();
mlt_properties_set(mlt_playlist_properties(playlist), "eof", "loop");
mlt_playlist_append(playlist, producer);
mlt_producer_close(producer);
mlt_consumer_connect(consumer, MLT_PLAYLIST_SERVICE(playlist));
mlt_consumer_start(consumer);
sleep(10);
mlt_consumer_stop(consumer);
mlt_consumer_close(consumer);
mlt_playlist_close(playlist);
#else
mlt_producer_close(producer);
#endif
mlt_profile_close(profile);
mlt_factory_close();
return 0;
};
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel