summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorRodeo <[email protected]>2014-01-25 23:24:48 +0000
committerRodeo <[email protected]>2014-01-25 23:24:48 +0000
commitd7ad9c9682d83dc8f59bd6ff86d3ec422c1f6adb (patch)
tree2dffccb32b266858c1d52f3d63463e83c049937a /macosx
parentebf885ce8a75dd392e2acab9a8a0e29032e05f71 (diff)
decavcodec: DRC support.
Adds DRC support for E-AC-3 audio (as well as any future libavcodec decoders with DRC support). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5995 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r--macosx/English.lproj/MainMenu.xib14
-rw-r--r--macosx/HBAudio.m7
-rw-r--r--macosx/HBAudioController.h1
-rw-r--r--macosx/HBAudioController.m7
4 files changed, 17 insertions, 12 deletions
diff --git a/macosx/English.lproj/MainMenu.xib b/macosx/English.lproj/MainMenu.xib
index 0a7f82d5b..1d3601fe8 100644
--- a/macosx/English.lproj/MainMenu.xib
+++ b/macosx/English.lproj/MainMenu.xib
@@ -5677,7 +5677,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>bitRates</string>
<string>bitRates.keyAudioBitrateName</string>
<string>bitRate</string>
- <string>AC3Enabled</string>
+ <string>DRCEnabled</string>
<string>gain</string>
<string>PassThruEnabled</string>
<string>PassThruDisabled</string>
@@ -7360,15 +7360,15 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
- <string key="label">enabled: arrangedObjects.AC3Enabled</string>
+ <string key="label">enabled: arrangedObjects.DRCEnabled</string>
<reference key="source" ref="581296833"/>
<reference key="destination" ref="141316080"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="581296833"/>
<reference key="NSDestination" ref="141316080"/>
- <string key="NSLabel">enabled: arrangedObjects.AC3Enabled</string>
+ <string key="NSLabel">enabled: arrangedObjects.DRCEnabled</string>
<string key="NSBinding">enabled</string>
- <string key="NSKeyPath">arrangedObjects.AC3Enabled</string>
+ <string key="NSKeyPath">arrangedObjects.DRCEnabled</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
@@ -7405,15 +7405,15 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
- <string key="label">enabled: arrangedObjects.AC3Enabled</string>
+ <string key="label">enabled: arrangedObjects.DRCEnabled</string>
<reference key="source" ref="393032802"/>
<reference key="destination" ref="141316080"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="393032802"/>
<reference key="NSDestination" ref="141316080"/>
- <string key="NSLabel">enabled: arrangedObjects.AC3Enabled</string>
+ <string key="NSLabel">enabled: arrangedObjects.DRCEnabled</string>
<string key="NSBinding">enabled</string>
- <string key="NSKeyPath">arrangedObjects.AC3Enabled</string>
+ <string key="NSKeyPath">arrangedObjects.DRCEnabled</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
diff --git a/macosx/HBAudio.m b/macosx/HBAudio.m
index 514096cf6..91e18f9d8 100644
--- a/macosx/HBAudio.m
+++ b/macosx/HBAudio.m
@@ -564,16 +564,17 @@ static NSMutableArray *masterBitRateArray = nil;
return retval;
}
-- (BOOL) AC3Enabled
+- (BOOL) DRCEnabled
{
BOOL retval = [self enabled];
if (retval)
{
+ int myTrackParam = [[[self track] objectForKey: keyAudioInputCodecParam] intValue];
int myTrackCodec = [[[self track] objectForKey: keyAudioInputCodec] intValue];
int myCodecCodec = [[[self codec] objectForKey: keyAudioCodec] intValue];
- if (HB_ACODEC_AC3 != myTrackCodec || HB_ACODEC_AC3_PASS == myCodecCodec)
+ if (!hb_audio_can_apply_drc(myTrackCodec, myTrackParam, myCodecCodec))
{
retval = NO;
}
@@ -610,7 +611,7 @@ static NSMutableArray *masterBitRateArray = nil;
{
retval = [NSSet setWithObjects: @"track", @"codec", nil];
}
- else if ([key isEqualToString: @"AC3Enabled"])
+ else if ([key isEqualToString: @"DRCEnabled"])
{
retval = [NSSet setWithObjects: @"track", @"codec", nil];
}
diff --git a/macosx/HBAudioController.h b/macosx/HBAudioController.h
index 3b0d884b1..c35f5dac9 100644
--- a/macosx/HBAudioController.h
+++ b/macosx/HBAudioController.h
@@ -13,6 +13,7 @@ extern NSString *keyAudioTrackName;
extern NSString *keyAudioInputBitrate;
extern NSString *keyAudioInputSampleRate;
extern NSString *keyAudioInputCodec;
+extern NSString *keyAudioInputCodecParam;
extern NSString *keyAudioInputChannelLayout;
extern NSString *HBMixdownChangedNotification;
diff --git a/macosx/HBAudioController.m b/macosx/HBAudioController.m
index 983002306..80ad96c31 100644
--- a/macosx/HBAudioController.m
+++ b/macosx/HBAudioController.m
@@ -15,6 +15,7 @@ NSString *keyAudioTrackName = @"keyAudioTrackName";
NSString *keyAudioInputBitrate = @"keyAudioInputBitrate";
NSString *keyAudioInputSampleRate = @"keyAudioInputSampleRate";
NSString *keyAudioInputCodec = @"keyAudioInputCodec";
+NSString *keyAudioInputCodecParam = @"keyAudioInputCodecParam";
NSString *keyAudioInputChannelLayout = @"keyAudioInputChannelLayout";
NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
@@ -112,8 +113,9 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
[aDict setObject: [NSNumber numberWithInt:0] forKey: [prefix stringByAppendingString: @"TrackGainSlider"]];
}
- if ((HB_ACODEC_AC3 == [[[anAudio track] objectForKey: keyAudioInputCodec] intValue]) &&
- (HB_ACODEC_AC3_PASS != [[[anAudio codec] objectForKey: keyAudioCodec] intValue]))
+ if (hb_audio_can_apply_drc([[[anAudio track] objectForKey: keyAudioInputCodec] intValue],
+ [[[anAudio track] objectForKey: keyAudioInputCodecParam] intValue],
+ [[[anAudio codec] objectForKey: keyAudioCodec] intValue]))
{
[aDict setObject: [anAudio drc] forKey: [prefix stringByAppendingString: @"TrackDRCSlider"]];
}
@@ -609,6 +611,7 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
[NSNumber numberWithInt: audio->in.bitrate / 1000], keyAudioInputBitrate,
[NSNumber numberWithInt: audio->in.samplerate], keyAudioInputSampleRate,
[NSNumber numberWithInt: audio->in.codec], keyAudioInputCodec,
+ [NSNumber numberWithInt: audio->in.codec_param], keyAudioInputCodecParam,
[NSNumber numberWithUnsignedLongLong: audio->in.channel_layout], keyAudioInputChannelLayout,
nil]];
}