libvlc_media_player_stop crash in 1.0.1

This forum is about all development around libVLC.
matejzavrsnik
New Cone
New Cone
Posts: 4
Joined: 14 Aug 2009 10:24

libvlc_media_player_stop crash in 1.0.1

Postby matejzavrsnik » 14 Aug 2009 12:14

This crash only happens under these circumstances:
- when in release mode (not in debug mode)
- when vlc instance is NOT initialized with "--no-audio" argument
- with vlc 1.0.1 (I also tested with 0.9.10 and it worked fine with the same code)

Video and audio play fine and then libvlc_media_player_stop function crashes whole application with RUN FAILED (exit value 139...). I'm using gentoo and qt4 and haven't tested in other systems. Is this a bug in vlc 1.0.1 or am I missing something?

Code to reproduce:

libvlc_instance_t* vlcInstance;
libvlc_exception_t vlcException;
libvlc_media_player_t *player;
libvlc_media_t *media;

QTimer timer;
QEventLoop loop;
timer.setSingleShot(true);
QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));

const char * const vlc_args[] = {
//"--no-audio" //uncomment to see that with this argument it works ok
};

libvlc_exception_init (&vlcException);
vlcInstance = libvlc_new (sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args, &vlcException);

media = libvlc_media_new (vlcInstance, "video.avi", &vlcException);
player = libvlc_media_player_new_from_media (media, &vlcException);

libvlc_media_player_set_xwindow(player, widget.frameResults->winId(), &vlcException);
//libvlc_drawable_t drawable = widget.frameResults->winId(); //uncomment to test on vlc<1.0.0
//libvlc_media_player_set_drawable (player, drawable, &vlcException);

libvlc_media_player_play (player, &vlcException);

timer.start(5000); // let it play for 5s
loop.exec();

libvlc_media_player_stop (player, &vlcException); // crashes here

XilasZ
Developer
Developer
Posts: 189
Joined: 16 Jun 2009 20:35

Re: libvlc_media_player_stop crash in 1.0.1

Postby XilasZ » 14 Aug 2009 16:05

Try to remove the display surface from libvlc (set_xwindow(null)) before calling stop().

See here : viewtopic.php?f=32&t=62504&start=0&hilit=delphi
and my post here : viewtopic.php?f=32&t=52021&start=135#p211595

It solved the random crash i had.

matejzavrsnik
New Cone
New Cone
Posts: 4
Joined: 14 Aug 2009 10:24

Re: libvlc_media_player_stop crash in 1.0.1

Postby matejzavrsnik » 17 Aug 2009 10:42

Thank you very much for the idea, I tried this trick on vlc1.0.1 but it didn't work. I doubt that the problem is in xwindow, since it only crashes when audio is enabled. I was thinking more in the direction of freeing some audio channel or something, must be a functionality new in vlc>1, but couln't find it in documentation.

Thanks anyway.

XilasZ
Developer
Developer
Posts: 189
Joined: 16 Jun 2009 20:35

Re: libvlc_media_player_stop crash in 1.0.1

Postby XilasZ » 17 Aug 2009 15:54

Sorry for the false hope :p

I have no idea why it could crash just because of audio ...
hmm, that reminds me of something : try to add the path where the plugin folder is located (i guess the same one where libvlc and your program is) at the beginning of the argument array.
http://mailman.videolan.org/pipermail/v ... 35853.html

Anyway, you can try something like libvlc_set_audio_track(-1) to disable audio.

matejzavrsnik
New Cone
New Cone
Posts: 4
Joined: 14 Aug 2009 10:24

Re: libvlc_media_player_stop crash in 1.0.1

Postby matejzavrsnik » 01 Sep 2009 12:37

Thanks for replying. This didn't work either. Must be some bug or something. I'll try to look into that, if I get some time allotted for this. Until then it's vlc<1 for me.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 59 guests