diff options
author | ritsuka <[email protected]> | 2014-08-16 18:26:24 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2014-08-16 18:26:24 +0000 |
commit | fe03ece379b5ceaeb25f5fe566434c864cbdeb3b (patch) | |
tree | b2d176c13c77ad1f982e61dac23d167afcb03403 | |
parent | cfc2be0c1e0ba120de2d798e6bbd3bd5c063cd10 (diff) |
MacGui: fixed the bitrates popup in the audio default panel, it didn’t update properly when the sample rate was set to auto.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6303 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | macosx/HBAudioSettings.m | 6 | ||||
-rw-r--r-- | macosx/HBAudioTrackPreset.m | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/macosx/HBAudioSettings.m b/macosx/HBAudioSettings.m index e5e65ea62..ba645cdf2 100644 --- a/macosx/HBAudioSettings.m +++ b/macosx/HBAudioSettings.m @@ -148,6 +148,12 @@ 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]; diff --git a/macosx/HBAudioTrackPreset.m b/macosx/HBAudioTrackPreset.m index 099cb6045..7a0f4d39d 100644 --- a/macosx/HBAudioTrackPreset.m +++ b/macosx/HBAudioTrackPreset.m @@ -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 |