aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2010-07-24 11:04:33 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2010-07-24 11:04:33 +0000
commit120e292ac7e5eafa996b1644f78df64a44164531 (patch)
tree4ddc9fe4aadfb6fe7bd5e7bc0fff256d12bfef29
parentd2d062fa716a79ccf161fc302e73723f3eb1bb8d (diff)
downloadqmmp-120e292ac7e5eafa996b1644f78df64a44164531.tar.gz
qmmp-120e292ac7e5eafa996b1644f78df64a44164531.tar.bz2
qmmp-120e292ac7e5eafa996b1644f78df64a44164531.zip
fixed possible freezes with mplayer
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1806 90c681e8-e032-0410-971d-27865f9a5e38
-rw-r--r--src/plugins/Engines/mplayer/mplayerengine.cpp8
-rw-r--r--src/plugins/General/notifier/popupwidget.cpp9
2 files changed, 10 insertions, 7 deletions
diff --git a/src/plugins/Engines/mplayer/mplayerengine.cpp b/src/plugins/Engines/mplayer/mplayerengine.cpp
index 2545ecb6e..c3a969d2a 100644
--- a/src/plugins/Engines/mplayer/mplayerengine.cpp
+++ b/src/plugins/Engines/mplayer/mplayerengine.cpp
@@ -31,7 +31,7 @@
#include <qmmp/inputsource.h>
#include "mplayerengine.h"
-#define MPLAYER_DEBUG
+//#define MPLAYER_DEBUG
static QRegExp rx_av("^[AV]: *([0-9,:.-]+)");
static QRegExp rx_pause("^(.*)=(.*)PAUSE(.*)");
@@ -42,6 +42,7 @@ static QRegExp rx_audio("^AUDIO: *([0-9,.]+) *Hz.*([0-9,.]+) *ch.*([0-9]+).* ([0
FileInfo *MplayerInfo::createFileInfo(const QString &path)
{
+ qDebug("%s", Q_FUNC_INFO);
QRegExp rx_id_length("^ID_LENGTH=([0-9,.]+)*");
QStringList args;
args << "-slave";
@@ -55,7 +56,7 @@ FileInfo *MplayerInfo::createFileInfo(const QString &path)
args << path;
QProcess mplayer_process;
mplayer_process.start("mplayer", args);
- mplayer_process.waitForFinished();
+ mplayer_process.waitForFinished(1500);
QString str = QString::fromLocal8Bit(mplayer_process.readAll()).trimmed();
FileInfo *info = new FileInfo(path);
QStringList lines = str.split("\n");
@@ -67,6 +68,7 @@ FileInfo *MplayerInfo::createFileInfo(const QString &path)
#ifdef MPLAYER_DEBUG
qDebug("%s",qPrintable(str));
#endif
+ qDebug("%s+", Q_FUNC_INFO);
return info;
}
@@ -95,7 +97,7 @@ MplayerEngine::MplayerEngine(QObject *parent)
MplayerEngine::~MplayerEngine()
{
qDebug("%s",__FUNCTION__);
- m_process->close();
+ m_process->kill();
}
bool MplayerEngine::play()
diff --git a/src/plugins/General/notifier/popupwidget.cpp b/src/plugins/General/notifier/popupwidget.cpp
index 1fa980e3f..e245b99c6 100644
--- a/src/plugins/General/notifier/popupwidget.cpp
+++ b/src/plugins/General/notifier/popupwidget.cpp
@@ -49,6 +49,7 @@ PopupWidget::PopupWidget(QWidget *parent)
m_label1 = new QLabel(this);
hlayout->addWidget (m_label1);
+ setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
//settings
QSettings settings(Qmmp::configFile(), QSettings::IniFormat);
@@ -109,10 +110,10 @@ void PopupWidget::showMetaData()
m_pixlabel->setPixmap(QPixmap(":/notifier_icon.png"));
m_pixlabel->setFixedSize(32,32);
}
- show();
- qApp->processEvents();
updateGeometry();
- resize(sizeHint());
+ setFixedSize(sizeHint());
+ update();
+ show();
updatePosition();
m_timer->start();
}
@@ -125,7 +126,7 @@ void PopupWidget::showVolume(int v)
m_label1->setAlignment(Qt::AlignVCenter);
m_label1->setText("<b>" + tr("Volume:") + QString (" %1\%").arg(v)+ + "</b>");
- show();
+
qApp->processEvents();
updateGeometry();
resize(sizeHint());