]> granicus.if.org Git - handbrake/commitdiff
MacGui: fixed the bitrates popup in the audio default panel, it didn’t update properl...
authorritsuka <damiog@gmail.com>
Sat, 16 Aug 2014 18:26:24 +0000 (18:26 +0000)
committerritsuka <damiog@gmail.com>
Sat, 16 Aug 2014 18:26:24 +0000 (18:26 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6303 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/HBAudioSettings.m
macosx/HBAudioTrackPreset.m

index e5e65ea6260a63a7757bc9928b8a17f7fb9204ed..ba645cdf2b067e204dd6b23ea79e5e292f253017 100644 (file)
         if ([track[@"AudioSamplerate"] isKindOfClass:[NSString class]])
         {
             newTrack.sampleRate = hb_audio_samplerate_get_from_name([track[@"AudioSamplerate"] UTF8String]);
+
+            // Set to "Auto" if we didn't find a valid sample rate.
+            if (newTrack.sampleRate == -1)
+            {
+                newTrack.sampleRate = 0;
+            }
         }
         newTrack.bitRate = [track[@"AudioBitrate"] intValue];
 
index 099cb6045996ee6df9c6877dfe033f881e0f5b29..7a0f4d39d1430e215ef61f89d90d3dec824fd3b1 100644 (file)
@@ -311,7 +311,12 @@ static void *HBAudioEncoderContex = &HBAudioEncoderContex;
 
 - (id)reverseTransformedValue:(id)value
 {
-    return @(hb_audio_samplerate_get_from_name([value UTF8String]));
+    int sampleRate = hb_audio_samplerate_get_from_name([value UTF8String]);
+    if (sampleRate < 0)
+    {
+        sampleRate = 0;
+    }
+    return @(sampleRate);
 }
 
 @end