Hi. My program is crashing when I try to play a video on it.
Qt Code:
  1. videoPlayer = new QMediaPlayer();
  2. videoItem = new QGraphicsVideoItem();
  3. videoItem->setSize(QSize(gameWidth + 4, gameHeight + 4));
  4. videoItem->setAspectRatioMode(Qt::KeepAspectRatioByExpanding);
  5. videoPlayer->setVideoOutput(videoItem);
  6. videoPlayer->setMuted(true);
  7. videoPlayer->setNotifyInterval(500);
  8. scene->addItem(videoItem);
To copy to clipboard, switch view to plain text mode 
Then then I have a function that I call when I show a video:
Qt Code:
  1. if (videoPlayer->state() != QMediaPlayer::PlayingState) {
  2. QFileInfo media_info(gameDirectory + video_url);
  3. if (media_info.isFile()) {
  4. video_url = "";
  5. videoItem->show();
  6. videoPlayer->setMedia(QUrl::fromLocalFile(media_info.absoluteFilePath()));
  7. videoPlayer->play();
  8. }
  9. }
To copy to clipboard, switch view to plain text mode 
The error I get is this:
ASSERT: "m_surface" in file player\mfvideorenderercontrol.cpp

Call stack:
Qt Code:
  1. > Qt5Cored.dll!666a4ab1() Unknown
  2. Qt5Cored.dll![Frames below may be incorrect and/or missing, no symbols loaded for Qt5Cored.dll] Unknown
  3. [External Code]
  4. wmfengined.dll!MFVideoRendererControl::createActivate() Line 2346 C++
  5. wmfengined.dll!MFPlayerSession::addOutputNode(IMFStreamDescriptor * streamDesc, MFPlayerSession::MediaType & mediaType, IMFTopology * topology, unsigned long sinkID) Line 406 C++
  6. wmfengined.dll!MFPlayerSession::setupPlaybackTopology(IMFMediaSource * source, IMFPresentationDescriptor * sourcePD) Line 308 C++
  7. wmfengined.dll!MFPlayerSession::handleMediaSourceReady() Line 266 C++
  8. wmfengined.dll!MFPlayerSession::qt_static_metacall(QObject * _o, QMetaObject::Call _c, int _id, void * * _a) Line 148 C++
  9. [External Code]
  10. qwindowsd.dll!QWindowsGuiEventDispatcher::sendPostedEvents() Line 81 C++
  11. [External Code]
To copy to clipboard, switch view to plain text mode 

If I ignore the error, the video plays just fine which is really confusing.
Can someone please explain to me where I'm going wrong?