[vlc-devel] MediaPlayer crash or deadlock (only) if mouse moves over video after libvlc_MediaPlayerEndReached

Christian Gallant christian at masterkitchen.de
Thu Mar 18 09:06:40 CET 2010


Hi,

we discovered a strange error at the end of our movies playing in a QT-Framework with libvlc (1.0.3 or 1.0.5).

After the libvlc_MediaPlayerEndReached comes to the callback, we do something with the movie (reset, go back to main menu, or loop...). The libvlc_media_player seems to be deleted after the event so we delete the holder-widget as well an create a new one.

It has to be said, that I don´t call the methods directly  from the callback, but instead (as I read here) use a QCustomEvent which is fired with postEvent() at this point.
( Couldn´t find the libvlc_event_attach_async so it did it with QT)

So far everything works fine with one exception. If the user moves the mouse (cursor) over the video the app hangs at the destructor of our VLCPlayer Widget. This will not happen if we move the mouse over the VideoController- Widget or move the main Window...

Here Some code to see where it will hang. I commented the locations where the app will crash.

// Desctructor
VLCPlayer::~VLCPlayer()
{
        /* Stop playing if the user pressed the close button.

        libvlc_media_player_stop(_mp, &_vlcexcep);
        vlcraise (&_vlcexcep);

        NOTE: 1. It will crash here if the mouse was moved over the video.

        ...
        libvlc_event_detach(em_mp, libvlc_MediaPlayerEndReached, callbacks, this, &_vlcexcep);
        ...


        if (_mp) {
                libvlc_media_player_release(_mp);
                _mp = NULL;
        }
        vlcraise (&_vlcexcep);

        NOTE: 2. It will crash here as well if the mouse was moved over the video.

        if (_m) {
                libvlc_media_release(_m);
                _m = NULL;
        }

        vlcraise (&_vlcexcep);
        qDebug("~VLCPlayer released _m");

      libvlc_release(_vlcinstance);
        qDebug("~VLCPlayer released _vlcinstance");

    vlcraise (&_vlcexcep);
}


Once again: Everything works fine if we don´t move the cursor over the video. To have the cursor over it without moving is no problem.


Thanks for some hints.

Regards
Chris



More information about the vlc-devel mailing list