summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--macosx/HBAudioTrackPreset.m17
1 files changed, 2 insertions, 15 deletions
diff --git a/macosx/HBAudioTrackPreset.m b/macosx/HBAudioTrackPreset.m
index f3f40d813..4ebb2071d 100644
--- a/macosx/HBAudioTrackPreset.m
+++ b/macosx/HBAudioTrackPreset.m
@@ -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);