diff options
-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 |