Page 1 of 1

vlc1.0.5 memory leak

Posted: 02 Jul 2010 10:31
by ckl
Hi all,

when we useing the libvlc1.0.5 int QT under the linux we meet some problems.

I start a timer, set the time interval of 1 second and repeat call MainWindow::Play function in the timer.After a few hours,found memory of test programe growing.I suspect a memory leak occurs vlc1.0.5.
os:centos
lib:vlc1.0.5

void MainWindow::Play()
{
if ( b_flag)
{
libvlc_media_player_release(p_media_player);
usleep(100);
libvlc_release(p_instance);
usleep(100);
b_flag = false;
}
char *vlc_argv[] ={"--rtsp-caching=30"};
libvlc_exception_init(&ex);
p_instance = libvlc_new(sizeof(vlc_argv)/sizeof(vlc_argv[0]), vlc_argv, &ex);
p_media = libvlc_media_new(p_instance,path.toLatin1().data(), &ex);
Raise(&ex);
p_media_player = libvlc_media_player_new_from_media(p_media,&ex);
Raise(&ex);
libvlc_media_release(p_media);
Raise(&ex);
libvlc_media_player_set_drawable(p_media_player,(libvlc_drawable_t)ui->label->winId(), &ex);
Raise(&ex);
libvlc_media_player_play(p_media_player, &ex);
Raise(&ex);
b_flag = true;
}

so,our questions are that:
1.How to avoid memory leaks using vlc1.0.5? :(

please do us a favor ,thank you!

Re: vlc1.0.5 memory leak

Posted: 02 Jul 2010 12:15
by Jean-Baptiste Kempf
Should be fixed in 1.1.0

Re: vlc1.0.5 memory leak

Posted: 09 Jul 2010 14:28
by sum_agg
For looping purpose,you need not call libvlc_new, libvlc_medial_player_new and libvlc_media_new. Just call "play" in the loop. This should achieve the purpose without object creation overhead.
offcourse memory leak should be solved.
Try vlc 1.1.0 as suggested..

Re: vlc1.0.5 memory leak

Posted: 16 Jul 2010 16:33
by sum_agg
Did you get the solution of memory leak?
Please post your solution if any.

Thanks