vlc1.0.5 memory leak

This forum is about all development around libVLC.
ckl
New Cone
New Cone
Posts: 6
Joined: 23 Jun 2010 04:51

vlc1.0.5 memory leak

Postby ckl » 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!

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: vlc1.0.5 memory leak

Postby Jean-Baptiste Kempf » 02 Jul 2010 12:15

Should be fixed in 1.1.0
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

sum_agg
New Cone
New Cone
Posts: 5
Joined: 18 Mar 2010 05:57

Re: vlc1.0.5 memory leak

Postby sum_agg » 09 Jul 2010 14:28

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..

sum_agg
New Cone
New Cone
Posts: 5
Joined: 18 Mar 2010 05:57

Re: vlc1.0.5 memory leak

Postby sum_agg » 16 Jul 2010 16:33

Did you get the solution of memory leak?
Please post your solution if any.

Thanks


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 16 guests