From 8be786a08e1368e7420a13b6f8ca99e560f287ff Mon Sep 17 00:00:00 2001 From: sr55 Date: Tue, 12 Apr 2016 19:04:11 +0100 Subject: WinGui: Handle null mixdowns properly. Fixes #152 --- win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs | 3 +-- win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'win/CS/HandBrakeWPF/Services') diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs index ea90a50f3..0f9aa02fd 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs @@ -340,7 +340,6 @@ namespace HandBrakeWPF.Services.Encode.Factories Validate.NotNull(encoder, "Unrecognized audio encoder:" + item.Encoder); HBMixdown mixdown = HandBrakeEncoderHelpers.GetMixdown(item.MixDown); - Validate.NotNull(mixdown, "Unrecognized audio mixdown:" + item.MixDown); HBRate sampleRate = HandBrakeEncoderHelpers.AudioSampleRates.FirstOrDefault(s => s.Name == item.SampleRate.ToString(CultureInfo.InvariantCulture)); @@ -350,7 +349,7 @@ namespace HandBrakeWPF.Services.Encode.Factories DRC = item.DRC, Encoder = encoder.Id, Gain = item.Gain, - Mixdown = mixdown.Id, + Mixdown = mixdown != null ? mixdown.Id : -1, NormalizeMixLevel = false, Samplerate = sampleRate != null ? sampleRate.Rate : 0, Name = item.TrackName, diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs index 3156d5a83..43138481a 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs @@ -160,7 +160,7 @@ namespace HandBrakeWPF.Services.Encode.Model.Models /// /// Gets or sets Audio Encoder /// - public HandBrakeWPF.Services.Encode.Model.Models.AudioEncoder Encoder + public AudioEncoder Encoder { get { @@ -214,7 +214,7 @@ namespace HandBrakeWPF.Services.Encode.Model.Models /// /// Gets or sets the encoder rate type. /// - public HandBrakeWPF.Services.Encode.Model.Models.AudioEncoderRateType EncoderRateType + public AudioEncoderRateType EncoderRateType { get { @@ -435,7 +435,7 @@ namespace HandBrakeWPF.Services.Encode.Model.Models /// Gets the audio encoder rate types. /// [JsonIgnore] - public IEnumerable AudioEncoderRateTypes + public IEnumerable AudioEncoderRateTypes { get { -- cgit v1.2.3