summaryrefslogtreecommitdiffstats
path: root/macosx/HBAudioController.m
diff options
context:
space:
mode:
authorRodeo <[email protected]>2013-04-28 21:05:55 +0000
committerRodeo <[email protected]>2013-04-28 21:05:55 +0000
commit0b0ecc8e17212f2081f0b942c54dc7abdbb22dba (patch)
treeb23b25f949276e17d781d5fb487df0d2a1598c07 /macosx/HBAudioController.m
parenta9e2b0dfab1a54db3e8f5e0cc1c1f14fe41e98e2 (diff)
MacGui: harmonize audio configuration code in prepareJob and prepareAudioForJob.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5422 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBAudioController.m')
-rw-r--r--macosx/HBAudioController.m32
1 files changed, 16 insertions, 16 deletions
diff --git a/macosx/HBAudioController.m b/macosx/HBAudioController.m
index 5e4a32508..353e24f16 100644
--- a/macosx/HBAudioController.m
+++ b/macosx/HBAudioController.m
@@ -150,27 +150,27 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
unsigned int audioArrayCount = [self countOfAudioArray];
for (i = 0; i < audioArrayCount; i++)
{
- HBAudio *anAudio = [self objectInAudioArrayAtIndex: i];
+ HBAudio *anAudio = [self objectInAudioArrayAtIndex:i];
if ([anAudio enabled])
{
- NSNumber *sampleRateToUse = (0 == [[[anAudio sampleRate] objectForKey: keyAudioSamplerate] intValue]) ?
- [[anAudio track] objectForKey: keyAudioInputSampleRate] :
- [[anAudio sampleRate] objectForKey: keyAudioSamplerate];
+ NSNumber *sampleRateToUse = ([[[anAudio sampleRate] objectForKey:keyAudioSamplerate] intValue] == 0 ?
+ [[anAudio track] objectForKey:keyAudioInputSampleRate] :
+ [[anAudio sampleRate] objectForKey:keyAudioSamplerate]);
- hb_audio_config_t *audio = (hb_audio_config_t *) calloc(1, sizeof(*audio));
+ hb_audio_config_t *audio = (hb_audio_config_t*)calloc(1, sizeof(*audio));
hb_audio_config_init(audio);
- audio->in.track = [[[anAudio track] objectForKey: keyAudioTrackIndex] intValue] - 1;
+ audio->in.track = [[[anAudio track] objectForKey:keyAudioTrackIndex] intValue] - 1;
/* We go ahead and assign values to our audio->out.<properties> */
- audio->out.track = audio->in.track;
- audio->out.codec = [[[anAudio codec] objectForKey: keyAudioCodec] intValue];
- audio->out.compression_level = hb_get_default_audio_compression(audio->out.codec);
- audio->out.mixdown = [[[anAudio mixdown] objectForKey: keyAudioMixdown] intValue];
- audio->out.normalize_mix_level = 0;
- audio->out.bitrate = [[[anAudio bitRate] objectForKey: keyAudioBitrate] intValue];
- audio->out.samplerate = [sampleRateToUse intValue];
- audio->out.dynamic_range_compression = [[anAudio drc] floatValue];
- audio->out.gain = [[anAudio gain] floatValue];
- audio->out.dither_method = hb_audio_dither_get_default();
+ audio->out.track = audio->in.track;
+ audio->out.codec = [[[anAudio codec] objectForKey:keyAudioCodec] intValue];
+ audio->out.compression_level = hb_get_default_audio_compression(audio->out.codec);
+ audio->out.mixdown = [[[anAudio mixdown] objectForKey:keyAudioMixdown] intValue];
+ audio->out.normalize_mix_level = 0;
+ audio->out.bitrate = [[[anAudio bitRate] objectForKey:keyAudioBitrate] intValue];
+ audio->out.samplerate = [sampleRateToUse intValue];
+ audio->out.dynamic_range_compression = [[anAudio drc] floatValue];
+ audio->out.gain = [[anAudio gain] floatValue];
+ audio->out.dither_method = hb_audio_dither_get_default();
hb_audio_add(aJob, audio);
free(audio);