summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Services/Encode
diff options
context:
space:
mode:
authorsr55 <[email protected]>2016-04-09 15:24:50 +0100
committersr55 <[email protected]>2016-04-09 15:24:50 +0100
commitd3866786b03887914eb66f06dc1a529036e86244 (patch)
tree884d7e41c3af9debcafb0bda76d78f9222fd1eca /win/CS/HandBrakeWPF/Services/Encode
parent478431fc9ca190a8a43df354bd0a872903bb6c02 (diff)
WinGui: Sanitise all Mixdown selections. Passthru the Codec into the Scanned Track object.
Diffstat (limited to 'win/CS/HandBrakeWPF/Services/Encode')
-rw-r--r--win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs34
1 files changed, 26 insertions, 8 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs
index b875df16c..3156d5a83 100644
--- a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs
+++ b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs
@@ -148,9 +148,12 @@ namespace HandBrakeWPF.Services.Encode.Model.Models
set
{
- this.mixDown = value;
- this.NotifyOfPropertyChange(() => this.MixDown);
- this.SetupLimits();
+ if (!object.Equals(this.mixDown, value))
+ {
+ this.mixDown = value;
+ this.NotifyOfPropertyChange(() => this.MixDown);
+ this.SetupLimits();
+ }
}
}
@@ -166,6 +169,11 @@ namespace HandBrakeWPF.Services.Encode.Model.Models
set
{
+ if (object.Equals(this.encoder, value))
+ {
+ return;
+ }
+
this.encoder = value;
this.NotifyOfPropertyChange(() => this.Encoder);
this.NotifyOfPropertyChange(() => this.IsPassthru);
@@ -627,14 +635,24 @@ namespace HandBrakeWPF.Services.Encode.Model.Models
/// </summary>
private void GetDefaultMixdownIfNull()
{
- if ((this.mixDown == null || this.mixDown == "none" ) && this.ScannedTrack != null)
+ if (this.ScannedTrack == null)
{
- HBAudioEncoder aencoder =
- HandBrakeEncoderHelpers.GetAudioEncoder(EnumHelper<AudioEncoder>.GetShortName(this.encoder));
+ return;
+ }
+
+ HBAudioEncoder aencoder = HandBrakeEncoderHelpers.GetAudioEncoder(EnumHelper<AudioEncoder>.GetShortName(this.encoder));
+ HBMixdown currentMixdown = HandBrakeEncoderHelpers.GetMixdown(this.mixDown);
+ HBMixdown sanitisedMixdown = HandBrakeEncoderHelpers.SanitizeMixdown(currentMixdown, aencoder, (uint)this.ScannedTrack.ChannelLayout);
+ HBMixdown defaultMixdown = HandBrakeEncoderHelpers.GetDefaultMixdown(aencoder, (uint)this.ScannedTrack.ChannelLayout);
- HBMixdown mixdown = HandBrakeEncoderHelpers.GetDefaultMixdown(aencoder, (uint)this.ScannedTrack.ChannelLayout);
- this.MixDown = mixdown.ShortName;
+ if (this.mixDown == null || this.mixDown == "none")
+ {
+ this.MixDown = defaultMixdown.ShortName;
+ }
+ else
+ {
+ this.MixDown = sanitisedMixdown.ShortName;
}
}