]> git.sur5r.net Git - minitube/commitdiff
Fixed crash on video error
authorFlavio <flavio@odisseo.local>
Mon, 9 May 2011 10:29:44 +0000 (12:29 +0200)
committerFlavio <flavio@odisseo.local>
Mon, 9 May 2011 10:29:44 +0000 (12:29 +0200)
src/MediaView.cpp
src/video.cpp

index 9d5c684bbc80739ff65f454a7115f4304659fd59..66fc5ec1bcd681e7689651befa701a4250f4d807 100644 (file)
@@ -414,6 +414,10 @@ void MediaView::downloadStatusChanged() {
 
 void MediaView::startPlaying() {
     if (reallyStopped) return;
+    if (!downloadItem) {
+        skip();
+        return;
+    }
 
     // go!
     qDebug() << "Playing" << downloadItem->currentFilename();
index df2c9fe8848bac9be9c651b90093e34348b1514a..545c29827d5078ba0fcbae1009a624cbcd35b1eb 100644 (file)
@@ -169,6 +169,7 @@ void  Video::gotVideoInfo(QByteArray data) {
     int previousIndex = 0;
     while (currentIndex >= 0) {
         previousIndex = currentIndex - 1;
+        if (previousIndex < 0) previousIndex = 0;
         int definitionCode = definitionCodes.at(previousIndex);
         if (urlMap.contains(definitionCode)) {
             qDebug() << "Found format" << definitionCode;