vlc1.0.5 memory leak
Posted: 02 Jul 2010 10:31
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!
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!