Selaa lähdekoodia

Fix external subtitles.

Ian Walton 4 vuotta sitten
vanhempi
commit
b9f79f4c57
1 muutettua tiedostoa jossa 6 lisäystä ja 13 poistoa
  1. 6 13
      src/player/PlayerComponent.cpp

+ 6 - 13
src/player/PlayerComponent.cpp

@@ -860,20 +860,10 @@ void PlayerComponent::reselectStream(const QString &streamSelection, MediaType t
       streamName = streamSelection.mid(splitPos + 1);
     }
   }
-  else if (!streamSelection.isEmpty())
+  else if (streamSelection.isEmpty())
   {
-    if (target == MediaType::Audio)
-    {
-      // For some reason, audio stream selections never start with '#'.
-      streamID = streamSelection;
-      streamName = "";
-    }
-    else
-    {
-      // Legacy web-client single external subtitle
-      streamID = "0";
-      streamName = streamSelection;
-    }
+    mpv::qt::set_property(m_mpv, streamIdPropertyName, "no");
+    return;
   }
 
   if (!streamName.isEmpty())
@@ -899,6 +889,9 @@ void PlayerComponent::reselectStream(const QString &streamSelection, MediaType t
     {
       selection = map["id"].toString();
       break;
+    } else if (streamID.isEmpty() && map["external-filename"].toString() == streamName) {
+      selection = map["id"].toString();
+      break;
     }
   }