]> git.sur5r.net Git - minitube/blobdiff - src/MediaView.cpp
Fix HD indicator randomly not working
[minitube] / src / MediaView.cpp
index 8427aa6db037f4228527ffe7e058c6131f35a60c..ea0df725d13da13deb7d1a40a3ec07e91cd635c5 100644 (file)
@@ -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";
 }