diff options
author | sr55 <[email protected]> | 2013-06-16 16:00:15 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-06-16 16:00:15 +0000 |
commit | 9c4ba8930b22f92f0d8b985eb77a96fca4a62d28 (patch) | |
tree | 32a7a3ee495ab418936131a157c734052ea0f557 /win/CS/HandBrakeWPF | |
parent | 9dcc30ae3c509b338f2f777089d9c05d294ca4ea (diff) |
WiWinGui: Remap the audio and video encoders. Hopefully this should also be backwards compatible with user presets, but it is recommended to re-create any user presets to that the new keys get picked up incase we drop the fallbacks in the future.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5591 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF')
3 files changed, 21 insertions, 9 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioBitrateConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioBitrateConverter.cs index f4e805957..bd7aeffca 100644 --- a/win/CS/HandBrakeWPF/Converters/Audio/AudioBitrateConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioBitrateConverter.cs @@ -70,14 +70,10 @@ namespace HandBrakeWPF.Converters.Audio int samplerate = this.GetBestSampleRate(track);
int srShift = this.GetSamplerateShift(samplerate);
int lfeCount = this.GetLowFreqChannelCount(track.MixDown);
- int channels = this.GetChannelCount(track.MixDown) - lfeCount;
+ int channels = this.GetDiscreteChannelCount(track.MixDown) - lfeCount;
switch (track.Encoder)
{
- case AudioEncoder.Faac:
- low = (channels + lfeCount) * 32;
- max = (channels + lfeCount) * (192 >> srShift);
- break;
case AudioEncoder.ffaac:
low = ((channels + lfeCount) * 32);
max = ((channels + lfeCount) * ((192 + (64 * ((samplerate << srShift) >= 44100 ? 1 : 0))) >> srShift));
@@ -101,8 +97,17 @@ namespace HandBrakeWPF.Converters.Audio case AudioEncoder.Mp3Passthru:
case AudioEncoder.Passthrough:
case AudioEncoder.ffflac:
+ case AudioEncoder.ffflac24:
max = 1536; // Since we don't care, just set it to the max.
break;
+ case AudioEncoder.fdkaac:
+ low = channels * samplerate * 2 / 3000;
+ max = channels * samplerate * 6 / 1000;
+ break;
+ case AudioEncoder.fdkheaac:
+ low = (channels * (12 + (4 * (samplerate >= 44100 ? 1 : 0))));
+ max = (channels - (channels > 2 ? 1 : 0)) * (48 + (16 * (samplerate >= 22050 ? 1 : 0)));
+ break;
default:
max = 768;
break;
@@ -132,7 +137,7 @@ namespace HandBrakeWPF.Converters.Audio /// <returns>
/// The System.Int32.
/// </returns>
- private int GetChannelCount(Mixdown mixdown)
+ private int GetDiscreteChannelCount(Mixdown mixdown)
{
switch (mixdown)
{
@@ -228,6 +233,10 @@ namespace HandBrakeWPF.Converters.Audio {
// AC-3 < 32 kHz suffers from poor hardware compatibility
bestSamplerate = 32000;
+ }
+ else if ((samplerate < 16000) && (track.Encoder == AudioEncoder.fdkheaac))
+ {
+ bestSamplerate = 16000;
}
else
{
diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs index 1db7a7c0a..27cb2e5de 100644 --- a/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs @@ -51,6 +51,8 @@ namespace HandBrakeWPF.Converters.Audio List<AudioEncoder> encoders = EnumHelper<AudioEncoder>.GetEnumList().ToList();
EncodeTask task = values[1] as EncodeTask;
+ encoders.Remove(AudioEncoder.faac);
+
if (task != null && task.OutputFormat != OutputFormat.Mkv)
{
encoders.Remove(AudioEncoder.Vorbis);
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 222b8a71c..81ac6a688 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -938,7 +938,11 @@ namespace HandBrakeWPF.ViewModels // Perform an update check if required
this.updateService.PerformStartupUpdateCheck(this.HandleUpdateCheckResults);
+ // Show or Hide the Preset Panel.
+ this.IsPresetPanelShowing = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowPresetPanel);
+
// Setup the presets.
+ this.presetService.Load();
if (this.presetService.CheckIfPresetsAreOutOfDate())
if (!this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PresetNotification))
this.errorService.ShowMessageBox("HandBrake has determined your built-in presets are out of date... These presets will now be updated." + Environment.NewLine +
@@ -953,9 +957,6 @@ namespace HandBrakeWPF.ViewModels // Populate the Source menu with drives.
this.SourceMenu = new BindingList<SourceMenuItem>(this.GenerateSourceMenu());
- // Show or Hide the Preset Panel.
- this.IsPresetPanelShowing = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowPresetPanel);
-
// Log Cleaning
if (userSettingService.GetUserSetting<bool>(UserSettingConstants.ClearOldLogs))
{
|