summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-01-30 22:28:25 +0000
committersr55 <[email protected]>2015-01-30 22:28:25 +0000
commitc84b5b21193131d41633ce97e95f99d4aead811f (patch)
treed436fb813791577f9e4e6a9fd88a13037b18cb3b /win
parent4e341a86cf8893b13757634ba44fb2b9c23b5b0f (diff)
WinGui: Fix Average bitrate video rate type via the JSON API.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6835 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Json/Encode/Video.cs4
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs12
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs4
3 files changed, 13 insertions, 7 deletions
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Encode/Video.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Encode/Video.cs
index ede0f919c..3b2cd4571 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Encode/Video.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Encode/Video.cs
@@ -29,7 +29,7 @@ namespace HandBrake.Interop.Json.Encode
/// <summary>
/// Gets or sets the bitrate for the encode.
/// </summary>
- public int Bitrate { get; set; }
+ public int? Bitrate { get; set; }
/// <summary>
/// Gets or sets a value indicating whether two pass.
@@ -64,7 +64,7 @@ namespace HandBrake.Interop.Json.Encode
/// <summary>
/// Gets or sets the quality.
/// </summary>
- public double Quality { get; set; }
+ public double? Quality { get; set; }
/// <summary>
/// Gets or sets the tune.
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs
index 19a5e047c..c013c8221 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs
@@ -248,13 +248,19 @@ namespace HandBrake.Interop.Json.Factories
video.Codec = videoEncoder.Id;
}
- video.TwoPass = job.TwoPass;
- video.Turbo = job.TurboFirstPass;
+
video.Level = job.VideoLevel;
video.Options = job.VideoOptions;
video.Preset = job.VideoPreset;
video.Profile = job.VideoProfile;
- video.Quality = job.Quality;
+ if (job.VideoEncodeRateType == VideoEncodeRateType.ConstantQuality) video.Quality = job.Quality;
+ if (job.VideoEncodeRateType == VideoEncodeRateType.AverageBitrate)
+ {
+ video.Bitrate = job.VideoBitrate;
+ video.TwoPass = job.TwoPass;
+ video.Turbo = job.TurboFirstPass;
+ }
+
if (job.VideoTunes != null && job.VideoTunes.Count > 0)
{
video.Tune = string.Join(",", job.VideoTunes);
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs b/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs
index 1ea596ef7..0f18c5b86 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs
@@ -134,8 +134,8 @@ namespace HandBrakeWPF.Services.Presets.Model
}
this.Task = task;
- this.AudioTrackBehaviours = audioBehaviours;
- this.SubtitleTrackBehaviours = subtitleBehaviours;
+ this.AudioTrackBehaviours = new AudioBehaviours(audioBehaviours);
+ this.SubtitleTrackBehaviours = new SubtitleBehaviours(subtitleBehaviours);
}
/// <summary>