Right, thats what I was guessing. I'm using a Playlist, but in a more, let's say, dynamic way. I think Melted does this in a similar way.
All my playlists are created and updated on a mysql table. I then load the videos from the mysql table to a Mlt Playlist object loading them just one at a time. Every time a video is about to end, I check the table again, clear the playlist and add the next video. This way, my playlist is more accurate to the mysql table making the playlist count stay on no more than 2 videos. This works great with no hiccups. I've been testing it for a while now. I actually don't notice any big memory increase on a long Playlist playback, I only notice a bigger increase every time I stop and start the playback again. (When I stop playback, I call the stop function on the consumer object and clear the playlist). Is there a way to clear this pool manually. I would then call it, every time I stop the consumer. Thank you On Jun 4, 2012, at 2:32 PM, Dan Dennedy wrote: > On Mon, Jun 4, 2012 at 10:37 AM, Lars Klassen <[email protected]> wrote: >> Hi, I finally found the way to write to the mailing list, dumb me, and sorry >> Dan for those private emails. >> >> I'm using Mlt++ on a playout server I wrote and it works like charm. But I'm >> under the impression that it's leaking memory somewhere. To make things >> simple, I wrote a little test app that creates a new Producer every x >> seconds. The leak here is kinda "minor", after creating 1000 producers (and >> destroying them) I build something like 300 MB in Physical Memory. Here is >> the code to the test app: >> >> #include "mainwindow.h" >> #include "ui_mainwindow.h" >> #include <QTimer> >> #include <QDebug> >> MainWindow::MainWindow(QWidget *parent) : >> QMainWindow(parent), >> ui(new Ui::MainWindow), >> _i(0) >> { >> ui->setupUi(this); >> Mlt::Factory::init(); >> _profile = new Mlt::Profile("dv_pal"); >> newProducer(); >> } >> MainWindow::~MainWindow() >> { >> delete ui; >> } >> void MainWindow::newProducer() >> { >> Mlt::Producer *producer = new Mlt::Producer(*_profile, >> "/Users/larcho/Movies/01.avi", 0); >> producer->seek(40); >> delete producer; >> _i++; >> QTimer::singleShot(10, this, SLOT(newProducer())); >> qDebug() << _i; >> } >> >> This by the way was tested on QT 4.8.1 running on a Mac. But I noticed >> similar behavior on Ubuntu. >> >> Am I not destroying the Producer object properly? >> >> Thank you. >> >> PS: When I create the producer with no id (new Producer() ) the leak is not >> present. > > MLT uses internal memory pools for some things. It is not clear > whether whether mem is leaking or the pool has simply grown and some > mem chunks are available for reuse. In particular, avformat producer > has image caching and the image and audio data chunks of mlt_frame are > all using memory pools. > > Outside of this little program, in your app, if you are using a > playlist, then you may need to ensure that old playlist items are > removed. Or, if you want to have a large playlist and only do > sequential playout, then set autoclose=1 on the playlist object. ------------------------------------------------------------------------------ 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 [email protected] https://lists.sourceforge.net/lists/listinfo/mlt-devel
