+
+ // on regexp failure, stop and report error
+ if (!match || re.numCaptures() < 1) {
+ qDebug() << videoInfo;
+ re = QRegExp("^.*&reason=([^&]+).*$");
+ match = re.exactMatch(videoInfo);
+ if (match) {
+ // report the error in the status bar
+ QMainWindow* mainWindow = dynamic_cast<QMainWindow*>(qApp->topLevelWidgets().first());
+ QString errorMessage = QUrl::fromEncoded(re.cap(1).toUtf8()).toString().replace("+", " ");
+ int indexOfTag = errorMessage.indexOf("<");
+ if (indexOfTag != -1) {
+ errorMessage = errorMessage.left(indexOfTag);
+ }
+ if (mainWindow) mainWindow->statusBar()->showMessage(errorMessage);
+ emit errorStreamUrl(errorMessage);
+ } else
+ emit errorStreamUrl("Error parsing video info");
+ return;
+ }
+