]> granicus.if.org Git - handbrake/commitdiff
MacGui: remove workaround for the case where the output samplerate is auto and the...
authorRodeo <tdskywalker@gmail.com>
Sat, 16 May 2015 21:21:01 +0000 (21:21 +0000)
committerRodeo <tdskywalker@gmail.com>
Sat, 16 May 2015 21:21:01 +0000 (21:21 +0000)
libhb now handles it for us.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7200 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/HBAudioTrackPreset.m

index f3f40d81378459981799700e8db4690ccdf1d0c6..4ebb2071dff1b2dc2707e4f67cca2df8ee364bea 100644 (file)
@@ -87,17 +87,7 @@ static void *HBAudioEncoderContex = &HBAudioEncoderContex;
 
 - (void)validateBitrate
 {
-    int minBitRate = 0;
-    int maxBitRate = 0;
-
-    int sampleRate = self.sampleRate ? self.sampleRate : DEFAULT_SAMPLERATE;
-
-    hb_audio_bitrate_get_limits(self.encoder, sampleRate, self.mixdown, &minBitRate, &maxBitRate);
-
-    if (self.bitRate < minBitRate || self.bitRate > maxBitRate)
-    {
-        self.bitRate = maxBitRate;
-    }
+    self.bitRate = hb_audio_bitrate_get_best(self.encoder, self.bitRate, self.sampleRate, self.mixdown);
 }
 
 - (BOOL)mixdownEnabled
@@ -204,10 +194,7 @@ static void *HBAudioEncoderContex = &HBAudioEncoderContex;
     int minBitRate = 0;
     int maxBitRate = 0;
 
-    // If the samplerate is "Auto" pass a fake sampleRate to get the bitrates
-    int sampleRate = self.sampleRate ? self.sampleRate : DEFAULT_SAMPLERATE;
-
-    hb_audio_bitrate_get_limits(self.encoder, sampleRate, self.mixdown, &minBitRate, &maxBitRate);
+    hb_audio_bitrate_get_limits(self.encoder, self.sampleRate, self.mixdown, &minBitRate, &maxBitRate);
 
     NSMutableArray *bitrates = [[NSMutableArray alloc] init];
     for (const hb_rate_t *audio_bitrate = hb_audio_bitrate_get_next(NULL);