Explorar o código

Do not use MF AAC for unsupported sample rates

Fixes #493.
Vincent Lang %!s(int64=8) %!d(string=hai) anos
pai
achega
f3530cf2c1

+ 3 - 0
src/player/CodecsComponent.cpp

@@ -756,6 +756,9 @@ static CodecDriver selectBestDecoder(const StreamInfo& stream)
         // Arbitrary but documented and enforced 6 channel limit by MS.
         if (stream.audioChannels > 6)
           score = 1;
+        // Another arbitrary limit.
+        if (stream.audioSampleRate > 0 && (stream.audioSampleRate < 8000 || stream.audioSampleRate > 48000))
+          score = 1;
       }
     }
     else

+ 1 - 0
src/player/CodecsComponent.h

@@ -55,6 +55,7 @@ struct StreamInfo {
   QString codec;
   QString profile;
   int audioChannels;
+  int audioSampleRate;
   QSize videoResolution;
 };
 

+ 1 - 0
src/player/PlayerComponent.cpp

@@ -1204,6 +1204,7 @@ PlaybackInfo PlayerComponent::getPlaybackInfo()
     stream.isAudio = type == "audio";
     stream.codec = map["codec"].toString();
     stream.audioChannels = map["demux-channel-count"].toInt();
+    stream.audioSampleRate = map["demux-samplerate"].toInt();
     stream.videoResolution = QSize(map["demux-w"].toInt(), map["demux-h"].toInt());
 
     // Get the profile from the server, because mpv can't determine it yet.