summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Services
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-01-13 21:44:08 +0000
committersr55 <[email protected]>2017-01-13 21:44:08 +0000
commit4c8d30ae5f433ac80cc5c55b4853188a0df90db4 (patch)
treeb4e0dbf7f09898182b70c3e0ac5668297d5f45e0 /win/CS/HandBrakeWPF/Services
parent1ff916a4f3d1031f38d5e0dfa64877f2e0407970 (diff)
WinGui: Fix an issue which prevented the GUI from parsing presets with hb_presets_read_file_json becaused it returned an unnamed list when reading plist files. It can now handle PresetList or just unnamed Json List []
Also made the parser more tolerant to casing and unset and unexpected values.
Diffstat (limited to 'win/CS/HandBrakeWPF/Services')
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs
index f3b1bd56f..4a2c973c6 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs
@@ -309,7 +309,7 @@ namespace HandBrakeWPF.Services.Presets.Factories
preset.Task.VideoTunes.Add(new VideoTune(item, item));
}
}
- preset.Task.Framerate = importedPreset.VideoFramerate == "auto" || string.IsNullOrEmpty(importedPreset.VideoFramerate)
+ preset.Task.Framerate = importedPreset.VideoFramerate == "auto" || importedPreset.VideoFramerate == "Same as source" || string.IsNullOrEmpty(importedPreset.VideoFramerate)
? (double?)null
: double.Parse(importedPreset.VideoFramerate, CultureInfo.InvariantCulture);
string parsedValue = importedPreset.VideoFramerateMode;
@@ -403,7 +403,7 @@ namespace HandBrakeWPF.Services.Presets.Factories
track.MixDown = HandBrakeEncoderHelpers.GetMixdown(audioTrack.AudioMixdown);
// track.AudioNormalizeMixLevel = audioTrack.AudioNormalizeMixLevel;
- track.SampleRate = audioTrack.AudioSamplerate == "auto" ? 0 : double.Parse(audioTrack.AudioSamplerate);
+ track.SampleRate = string.IsNullOrEmpty(audioTrack.AudioSamplerate) || audioTrack.AudioSamplerate.ToLower() == "auto" ? 0 : double.Parse(audioTrack.AudioSamplerate);
track.EncoderRateType = audioTrack.AudioTrackQualityEnable ? AudioEncoderRateType.Quality : AudioEncoderRateType.Bitrate;
track.Quality = audioTrack.AudioTrackQuality;