ASSERT: “m_surface” when playing video
-
Hi,
I am having a problem when trying to display a video in a QGraphicsview on Windows. I am constantly getting an assert in debug
Program: c:\Qt\Qt5.3.2\5.3\msvc2013_64_opengl\bin\Qt5Cored.dll
Module: 5.3.2
File: global\qglobal.cpp
Line: 2127ASSERT: “m_surface” in file player\mfvideorenderercontrol.cpp, line 2349
Which I can ignore and it will work, however in release mode, it crashes instead.
Is there some call that I should be making prior to ensure that m_surface is never null by the time it hits this line?
more informations:
Os: windows 8.1 64 bitthis is snip of my code
@ QGraphicsScene *scene;
QMediaPlayer mp;
QGraphicsVideoItem v;
scene = new QGraphicsScene;
ui->graphicsView->setScene(scene);
QStringList list;
list <<QString("D:/files/3240/mov/1.mov") << QString("D:/files/3240/videos/newmov/1.mov")<<
QString("D:/files/3240/videos/3.mov")<< QString("D:/files/3240/videos/4.mov")
<<QString("D:/files/3240/videos/5.mov");
mp.setVideoOutput(&v);
mp.setMedia(QUrl::fromLocalFile(list.at(i%5)));
mp.play();
mp.setVolume(0);
scene->addItem(&v);@ -
Hi,
Where's that code called from ?
-
this is my code
@#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
i = 0;
scene = new QGraphicsScene;
ui->graphicsView->setScene(scene);
// setWindowFlags(Qt::FramelessWindowHint);
}MainWindow::~MainWindow()
{
delete ui;
}void MainWindow::resizeEvent(QResizeEvent *)
{}
void MainWindow::mousePressEvent(QMouseEvent *)
{}
void MainWindow::on_pushButton_clicked()
{
resize(1080,400);
QStringList list;
list <<QString("D:/files/3240/mov/1.mov") << QString("D:/files/3240/videos/newmov/1.mov")<<
QString("D:/files/3240/videos/3.mov")<< QString("D:/files/3240/videos/4.mov")
<<QString("D:/files/3240/videos/5.mov");
mp.setVideoOutput(&v);
mp.setMedia(QUrl::fromLocalFile(list.at(i%5)));
mp.play();
mp.setVolume(0);
scene->addItem(&v);
//v->setSize(QSize(width(),height()));
i++;
}
@ -
What is w ?
-
What happens if you start playing only after adding v to the scene ?
-
Since Qt 5.4 has been released, can you check if you still encounter this problem ?
-
Yes you will test or yes you still have this problem ?
-
Where's the assert located this time ?
Did you install the latest driver for your graphic card ?
-
@
mp.setVideoOutput(&v);
scene->addItem(&v);
@I'd move that in the constructor, there's no need to do that again each time.