Hi,
i've a problem using the phonon video player. I play a video on loop, but after some hours the application slow down. The memory usage is stable.
I use it in that way:
guiMain
::guiMain(QWidget *parent
) : ui(new Ui::guiMain)
{
...
//video
video=0;
videoFileName.append(conf::Instance()->systemVideoPath);
videoFileName.append(conf::Instance()->adsVideoFileName);
QFile videoFile
(videoFileName
);
videoRestartTime
=new QTimer(this);
if (videoFile.exists()){
ui->videoPlayer->show();
video = new Phonon::MediaSource(videoFileName);
ui->videoPlayer->play(*video);
connect(ui->videoPlayer->mediaObject(),SIGNAL(finished()), this,SLOT(videoRestart()));
pictureEnable=false;
videoEnable=true;
}else{
ui->videoPlayer->hide();
ui->lblAds->show();
pictureEnable=true;
videoEnable=false;
video=0;
}
}
guiMain::guiMain(QWidget *parent) :
QWidget(parent),
ui(new Ui::guiMain)
{
...
//video
video=0;
QString videoFileName;
videoFileName.append(conf::Instance()->systemVideoPath);
videoFileName.append(conf::Instance()->adsVideoFileName);
QFile videoFile(videoFileName);
videoRestartTime=new QTimer(this);
if (videoFile.exists()){
ui->videoPlayer->show();
video = new Phonon::MediaSource(videoFileName);
ui->videoPlayer->play(*video);
connect(ui->videoPlayer->mediaObject(),SIGNAL(finished()), this,SLOT(videoRestart()));
pictureEnable=false;
videoEnable=true;
}else{
ui->videoPlayer->hide();
ui->lblAds->show();
pictureEnable=true;
videoEnable=false;
video=0;
}
}
To copy to clipboard, switch view to plain text mode
void guiMain::videoRestart(){
if(videoEnable){
if (video!=0){
ui->videoPlayer->stop();
ui->videoPlayer->load(*video);
ui->videoPlayer->play();
}else
pErrorMng->alarmPush(302,warning,tr("Main Gui"), tr("Ads video not found"));
}
}
void guiMain::videoRestart(){
if(videoEnable){
if (video!=0){
ui->videoPlayer->stop();
ui->videoPlayer->load(*video);
ui->videoPlayer->play();
}else
pErrorMng->alarmPush(302,warning,tr("Main Gui"), tr("Ads video not found"));
}
}
To copy to clipboard, switch view to plain text mode
the ui->videoPlayer is a Phonon::videoPlayer
What is wrong?
Thanks
Bookmarks