summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gtk/src/presets.c1
-rw-r--r--macosx/Controller.m3
-rw-r--r--macosx/HBAudio.m27
-rw-r--r--macosx/HBAudioController.m19
4 files changed, 24 insertions, 26 deletions
diff --git a/gtk/src/presets.c b/gtk/src/presets.c
index 88970fce1..064d27323 100644
--- a/gtk/src/presets.c
+++ b/gtk/src/presets.c
@@ -2058,6 +2058,7 @@ value_map_t mix_xlat[] =
{"AC3 Passthru", "none"},
{"DTS Passthru", "none"},
{"DTS-HD Passthru", "none"},
+ {"None", "none"},
{NULL, NULL}
};
diff --git a/macosx/Controller.m b/macosx/Controller.m
index d47adde10..484ab3865 100644
--- a/macosx/Controller.m
+++ b/macosx/Controller.m
@@ -4520,9 +4520,6 @@ bool one_burned = FALSE;
[fVidEncoderPopUp selectItemAtIndex:0];
[self videoEncoderPopUpChanged:nil];
- /* changing the format may mean that we can / can't offer mono or 6ch, */
- /* so call audioTrackPopUpChanged for both audio tracks to update the mixdown popups */
-
/* We call the method to properly enable/disable turbo 2 pass */
[self twoPassCheckboxChanged: sender];
/* We call method method to change UI to reflect whether a preset is used or not*/
diff --git a/macosx/HBAudio.m b/macosx/HBAudio.m
index 706e8303b..d5169d11d 100644
--- a/macosx/HBAudio.m
+++ b/macosx/HBAudio.m
@@ -151,16 +151,8 @@ static NSMutableArray *masterBitRateArray = nil;
masterMixdownArray = [[NSMutableArray alloc] init]; // knowingly leaked
[masterMixdownArray addObject: [NSDictionary dictionaryWithObjectsAndKeys:
- NSLocalizedString(@"AC3 Passthru", @"AC3 Passthru"), keyAudioMixdownName,
- [NSNumber numberWithInt: HB_ACODEC_AC3_PASS], keyAudioMixdown,
- nil]];
- [masterMixdownArray addObject: [NSDictionary dictionaryWithObjectsAndKeys:
- NSLocalizedString(@"DTS Passthru", @"DTS Passthru"), keyAudioMixdownName,
- [NSNumber numberWithInt: HB_ACODEC_DCA_PASS], keyAudioMixdown,
- nil]];
- [masterMixdownArray addObject: [NSDictionary dictionaryWithObjectsAndKeys:
- NSLocalizedString(@"DTS-HD Passthru", @"DTS-HD Passthru"), keyAudioMixdownName,
- [NSNumber numberWithInt: HB_ACODEC_DCA_HD_PASS], keyAudioMixdown,
+ NSLocalizedString(@"None", @"None"), keyAudioMixdownName,
+ [NSNumber numberWithInt: 0], keyAudioMixdown,
nil]];
for (i = 0; i < hb_audio_mixdowns_count; i++)
{
@@ -290,13 +282,13 @@ static NSMutableArray *masterBitRateArray = nil;
// Basically with the way the mixdowns are stored, the assumption from the libhb point of view
// currently is that all mixdowns from the best down to mono are supported.
- if (currentMixdown <= theBestMixdown)
+ if (currentMixdown && currentMixdown <= theBestMixdown)
{
shouldAdd = YES;
}
- else if (0 == theBestMixdown && codecCodec == currentMixdown)
+ else if (0 == currentMixdown && (codecCodec & HB_ACODEC_PASS_FLAG))
{
- // 0 means passthrough, add the current mixdown if it matches the passthrough codec
+ // "None" mixdown (passthru)
shouldAdd = YES;
}
else
@@ -310,12 +302,6 @@ static NSMutableArray *masterBitRateArray = nil;
}
}
- if (0 == theDefaultMixdown)
- {
- // a mixdown of 0 means passthrough
- theDefaultMixdown = codecCodec;
- }
-
if (![self enabled])
{
permittedMixdowns = nil;
@@ -638,8 +624,9 @@ static NSMutableArray *masterBitRateArray = nil;
if (retval)
{
int myMixdown = [[[self mixdown] objectForKey: keyAudioMixdown] intValue];
- if (myMixdown & HB_ACODEC_PASS_FLAG)
+ if (0 == myMixdown)
{
+ // "None" mixdown (passthru)
retval = NO;
}
}
diff --git a/macosx/HBAudioController.m b/macosx/HBAudioController.m
index cab0a3df0..c350a80ac 100644
--- a/macosx/HBAudioController.m
+++ b/macosx/HBAudioController.m
@@ -280,6 +280,9 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
while (nil != (dict = [enumerator nextObject]))
{
+ // copy the dictionary since we may need to alter it
+ dict = [NSMutableDictionary dictionaryWithDictionary:dict];
+
if ([self countOfAudioArray] < maximumNumberOfAllowedAudioTracks)
{
BOOL fallenBack = NO;
@@ -288,19 +291,20 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
[self insertObject: newAudio inAudioArrayAtIndex: [self countOfAudioArray]];
[newAudio setVideoContainerTag: [self videoContainerTag]];
[newAudio setTrackFromIndex: trackIndex];
+
key = [dict objectForKey: @"AudioEncoder"];
if (0 == aType &&
[[NSUserDefaults standardUserDefaults] boolForKey: @"UseCoreAudio"] &&
[key isEqualToString: @"AAC (faac)"])
{
- key = @"AAC (CoreAudio)";
+ [dict setObject: @"AAC (CoreAudio)" forKey: @"AudioEncoder"];
}
if ([[NSUserDefaults standardUserDefaults] boolForKey: @"AC3PassthruDefaultsToAC3"] &&
[key isEqualToString: @"AC3 Passthru"])
{
if (![newAudio setCodecFromName: key])
{
- key = @"AC3";
+ [dict setObject: @"AC3" forKey: @"AudioEncoder"];
fallenBack = YES;
}
}
@@ -316,9 +320,18 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
[dict setObject:[NSNumber numberWithFloat:0.0] forKey:@"AudioTrackGainSlider"];
}
+ // map legacy passthru mixdowns
+ key = [dict objectForKey: @"AudioMixdown"];
+ if ([key isEqualToString: @"AC3 Passthru"] ||
+ [key isEqualToString: @"DTS Passthru"] ||
+ [key isEqualToString: @"DTS-HD Passthru"])
+ {
+ [dict setObject: @"None" forKey: @"AudioMixdown"];
+ }
+
// If our preset wants us to support a codec that the track does not support, instead
// of changing the codec we remove the audio instead.
- if ([newAudio setCodecFromName: key])
+ if ([newAudio setCodecFromName: [dict objectForKey: @"AudioEncoder"]])
{
[newAudio setMixdownFromName: [dict objectForKey: @"AudioMixdown"]];
[newAudio setSampleRateFromName: [dict objectForKey: @"AudioSamplerate"]];