Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt 5.12.10 play video crashed(vs2019 call stack)!



  • hi guys.
    I want to loop a video file:

        auto player = new QMediaPlayer;
        auto playlist = new QMediaPlaylist(player);
        auto videoWidget = new QVideoWidget(ui ->stackedWidget);
        player->setVideoOutput(videoWidget);
        playlist ->setPlaybackMode( QMediaPlaylist::CurrentItemInLoop );
        playlist->addMedia(
                    QUrl("qrc:/input1.avi") );
    
        playlist->setCurrentIndex(0);
        player ->setPlaylist( playlist );
        player->play();
    
        videoWidget->setGeometry( QRect(0,0,400,300) );
    

    Crash after playing it only once.
    If i use disk files, it works well.
    the call stack:

    TestVideoPlayer.exe!DirectShowIOReader::readyRead() line 347 C++
    TestVideoPlayer.exe!DirectShowIOReader::customEvent(QEvent * event) line 338 C++
    TestVideoPlayer.exe!QObject::event(QEvent * e) line 1284 C++
    TestVideoPlayer.exe!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) line 3650 C++
    TestVideoPlayer.exe!QApplication::notify(QObject * receiver, QEvent * e) line 3006 C++
    TestVideoPlayer.exe!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) line 1088 C++
    TestVideoPlayer.exe!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) line 1476 C++
    TestVideoPlayer.exe!DirectShowEventLoop::processEvents() line 147 C++
    TestVideoPlayer.exe!DirectShowEventLoop::customEvent(QEvent * event) line 128 C++
    TestVideoPlayer.exe!QObject::event(QEvent * e) line 1284 C++
    TestVideoPlayer.exe!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) line 3650 C++
    TestVideoPlayer.exe!QApplication::notify(QObject * receiver, QEvent * e) line 3006 C++
    TestVideoPlayer.exe!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) line 1088 C++
    TestVideoPlayer.exe!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) line 1476 C++
    TestVideoPlayer.exe!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) line 1825 C++
    TestVideoPlayer.exe!QEventDispatcherWin32::sendPostedEvents() line 1095 C++
    TestVideoPlayer.exe!QWindowsGuiEventDispatcher::sendPostedEvents() line 82 C++
    TestVideoPlayer.exe!qt_internal_proc(HWND__ * hwnd, unsigned int message, unsigned int wp, long lp) line 250 C++
    [External code]
    user32.dll![The following framework may be incorrect and/or missing, no symbols are loaded for user32.dll] Unknown
    TestVideoPlayer.exe!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) line 643 C++
    TestVideoPlayer.exe!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) line 74 C++
    TestVideoPlayer.exe!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) line 139 C++
    TestVideoPlayer.exe!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) line 225 C++
    TestVideoPlayer.exe!QCoreApplication::exec() line 1389 C++
    TestVideoPlayer.exe!QGuiApplication::exec() line 1785 C++
    TestVideoPlayer.exe!QApplication::exec() line 2859 C++
    TestVideoPlayer.exe!main(int argc, char * * argv) line 170 C++
    TestVideoPlayer.exe!WinMain(HINSTANCE__ * formal, HINSTANCE * __formal, char * __formal, int __formal) line 97 C++
    ![alt text](crashedcall.png image url)


  • Lifetime Qt Champion

    Hi,

    What happens if you call play yourself when the video has finished playing ?



  • @SGaist worked well,but there are black flashes after the end and before the start.


  • Lifetime Qt Champion

    Can you check if you have the same issue with the latest Qt 5.15 ?



  • @SGaist hey,i tried Qt5.15.2 in vs2019.works ,but not so good:just like:not smoothly. just like: start, end, start again, with black image flickering in the middle


  • Lifetime Qt Champion

    So the backend seems to have gotten improved in between. I currently wonder whether the files gets re-extracted at each read.


Log in to reply