From ba86b15f4e720f72eb9c4f33b2978b1b2372ef9e Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Thu, 5 Nov 2009 00:35:44 +0100 Subject: [PATCH] Fix HD indicator randomly not working Stop timers on video change --- src/MediaView.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/MediaView.cpp b/src/MediaView.cpp index 8427aa6..ea0df72 100644 --- a/src/MediaView.cpp +++ b/src/MediaView.cpp @@ -239,11 +239,14 @@ void MediaView::activeRowChanged(int row) { Video *video = listModel->videoAt(row); if (!video) return; + // now that we have a new video to play + // stop all the timers + workaroundTimer->stop(); + errorTimer->stop(); + // immediately show the loading widget videoAreaWidget->showLoading(video); - // mediaObject->pause(); - connect(video, SIGNAL(gotStreamUrl(QUrl)), SLOT(gotStreamUrl(QUrl))); // TODO handle signal in a proper slot and impl item error status connect(video, SIGNAL(errorStreamUrl(QString)), SLOT(handleError(QString))); @@ -286,7 +289,7 @@ void MediaView::gotStreamUrl(QUrl streamUrl) { qDebug() << "Cannot get sender"; return; } - bool ret = QMetaObject::invokeMethod(qApp->topLevelWidgets().first(), "hdIndicator", Qt::DirectConnection, Q_ARG(bool, video->isHd())); + bool ret = QMetaObject::invokeMethod(parent()->parent(), "hdIndicator", Qt::DirectConnection, Q_ARG(bool, video->isHd())); if (!ret) qDebug() << "hdIndicator invokeMethod failed"; } -- 2.39.5