diff options
author | sr55 <[email protected]> | 2015-01-30 22:28:25 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2015-01-30 22:28:25 +0000 |
commit | c84b5b21193131d41633ce97e95f99d4aead811f (patch) | |
tree | d436fb813791577f9e4e6a9fd88a13037b18cb3b /win/CS/HandBrake.Interop/HandBrakeInterop | |
parent | 4e341a86cf8893b13757634ba44fb2b9c23b5b0f (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/CS/HandBrake.Interop/HandBrakeInterop')
-rw-r--r-- | win/CS/HandBrake.Interop/HandBrakeInterop/Json/Encode/Video.cs | 4 | ||||
-rw-r--r-- | win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs | 12 |
2 files changed, 11 insertions, 5 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);
|