- if (HB_ACODEC_AC3 == trackCodec && HB_ACODEC_AC3_PASS == codecCodec) {
- [retval addObject: [NSDictionary dictionaryWithObjectsAndKeys:
- NSLocalizedString(@"AC3 Passthru", @"AC3 Passthru"), keyAudioMixdownName,
- [NSNumber numberWithInt: HB_ACODEC_AC3_PASS], keyAudioMixdown,
- [NSNumber numberWithBool: YES], keyAudioMixdownLimitsToTrackBitRate,
- [NSNumber numberWithBool: YES], keyAudioMixdownCanBeDefault,
- nil]];
- }
- else if (HB_ACODEC_DCA == trackCodec && HB_ACODEC_DCA_PASS == codecCodec) {
- [retval addObject: [NSDictionary dictionaryWithObjectsAndKeys:
- NSLocalizedString(@"DTS Passthru", @"DTS Passthru"), keyAudioMixdownName,
- [NSNumber numberWithInt: HB_ACODEC_DCA_PASS], keyAudioMixdown,
- [NSNumber numberWithBool: YES], keyAudioMixdownLimitsToTrackBitRate,
- [NSNumber numberWithBool: YES], keyAudioMixdownCanBeDefault,
- nil]];
- }
- else {
- int audioCodecsSupport6Ch = (trackCodec && HB_ACODEC_LAME != codecCodec);
- int channelLayout = [[track objectForKey: keyAudioInputChannelLayout] intValue];
- int layout = channelLayout & HB_INPUT_CH_LAYOUT_DISCRETE_NO_LFE_MASK;
-
- /* add a mono option? */
- [retval addObject: [NSDictionary dictionaryWithObjectsAndKeys:
- [NSString stringWithUTF8String: hb_audio_mixdowns[0].human_readable_name], keyAudioMixdownName,
- [NSNumber numberWithInt: hb_audio_mixdowns[0].amixdown], keyAudioMixdown,
- [NSNumber numberWithBool: NO], keyAudioMixdownLimitsToTrackBitRate,
- [NSNumber numberWithBool: YES], keyAudioMixdownCanBeDefault,
- nil]];
-
- /* offer stereo if we have a stereo-or-better source */
- if (layout >= HB_INPUT_CH_LAYOUT_STEREO) {
- [retval addObject: [NSDictionary dictionaryWithObjectsAndKeys:
- [NSString stringWithUTF8String: hb_audio_mixdowns[1].human_readable_name], keyAudioMixdownName,
- [NSNumber numberWithInt: hb_audio_mixdowns[1].amixdown], keyAudioMixdown,
- [NSNumber numberWithBool: NO], keyAudioMixdownLimitsToTrackBitRate,
- [NSNumber numberWithBool: YES], keyAudioMixdownCanBeDefault,
- nil]];
- }
-
- /* do we want to add a dolby surround (DPL1) option? */
- if (HB_INPUT_CH_LAYOUT_3F1R == layout || HB_INPUT_CH_LAYOUT_3F2R == layout || HB_INPUT_CH_LAYOUT_DOLBY == layout) {
- [retval addObject: [NSDictionary dictionaryWithObjectsAndKeys:
- [NSString stringWithUTF8String: hb_audio_mixdowns[2].human_readable_name], keyAudioMixdownName,
- [NSNumber numberWithInt: hb_audio_mixdowns[2].amixdown], keyAudioMixdown,
- [NSNumber numberWithBool: NO], keyAudioMixdownLimitsToTrackBitRate,
- [NSNumber numberWithBool: YES], keyAudioMixdownCanBeDefault,
- nil]];
- }
-
- /* do we want to add a dolby pro logic 2 (DPL2) option? */
- if (HB_INPUT_CH_LAYOUT_3F2R == layout) {
- [retval addObject: [NSDictionary dictionaryWithObjectsAndKeys:
- [NSString stringWithUTF8String: hb_audio_mixdowns[3].human_readable_name], keyAudioMixdownName,
- [NSNumber numberWithInt: hb_audio_mixdowns[3].amixdown], keyAudioMixdown,
- [NSNumber numberWithBool: NO], keyAudioMixdownLimitsToTrackBitRate,
- [NSNumber numberWithBool: YES], keyAudioMixdownCanBeDefault,
- nil]];
- }
-
- /* do we want to add a 6-channel discrete option? */
- if (1 == audioCodecsSupport6Ch && HB_INPUT_CH_LAYOUT_3F2R == layout && (channelLayout & HB_INPUT_CH_LAYOUT_HAS_LFE)) {
- [retval addObject: [NSDictionary dictionaryWithObjectsAndKeys:
- [NSString stringWithUTF8String: hb_audio_mixdowns[4].human_readable_name], keyAudioMixdownName,
- [NSNumber numberWithInt: hb_audio_mixdowns[4].amixdown], keyAudioMixdown,
- [NSNumber numberWithBool: NO], keyAudioMixdownLimitsToTrackBitRate,
- [NSNumber numberWithBool: (HB_ACODEC_AC3 == codecCodec) ? YES : NO], keyAudioMixdownCanBeDefault,
- nil]];
- }
-
- // based on the fact that we are in an else section where the ifs before hand would have detected the following two
- // situations, the following code will never add anything to the returned array. I am leaving this in place for
- // historical reasons.
- /* do we want to add an AC-3 passthrough option? */
- if (HB_ACODEC_AC3 == trackCodec && HB_ACODEC_AC3_PASS == codecCodec) {
- [retval addObject: [NSDictionary dictionaryWithObjectsAndKeys:
- [NSString stringWithUTF8String: hb_audio_mixdowns[5].human_readable_name], keyAudioMixdownName,
- [NSNumber numberWithInt: HB_ACODEC_AC3_PASS], keyAudioMixdown,
- [NSNumber numberWithBool: YES], keyAudioMixdownLimitsToTrackBitRate,
- [NSNumber numberWithBool: YES], keyAudioMixdownCanBeDefault,
- nil]];