diff options
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs | 2 | ||||
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs index 8dfb5d031..1c1e2ef60 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs +++ b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs @@ -222,7 +222,7 @@ namespace HandBrake.ApplicationServices.Model /// <summary>
/// Gets or sets Quality.
/// </summary>
- public double Quality { get; set; }
+ public double? Quality { get; set; }
/// <summary>
/// Gets or sets VideoBitrate.
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs index bd75880b9..87496dfbc 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs @@ -298,26 +298,26 @@ namespace HandBrake.ApplicationServices.Utilities switch (task.VideoEncodeRateType)
{
- case VideoEncodeRateMode.ConstantQuality:
+ case VideoEncodeRateMode.AverageBitrate:
if (task.VideoBitrate.HasValue)
query += string.Format(" -b {0}", task.VideoBitrate.Value);
break;
- case VideoEncodeRateMode.AverageBitrate:
+ case VideoEncodeRateMode.ConstantQuality:
double value;
switch (task.VideoEncoder)
{
case VideoEncoder.FFMpeg:
- value = 31 - (task.Quality - 1);
+ value = 31 - (task.Quality.Value - 1);
query += string.Format(" -q {0}", value.ToString(new CultureInfo("en-US")));
break;
case VideoEncoder.X264:
CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US");
- value = 51 - (task.Quality * x264CqStep);
+ value = 51 - (task.Quality.Value * x264CqStep);
value = Math.Round(value, 2);
query += string.Format(" -q {0}", value.ToString(culture));
break;
case VideoEncoder.Theora:
- value = task.Quality;
+ value = task.Quality.Value;
query += string.Format(" -q {0}", value.ToString(new CultureInfo("en-US")));
break;
}
|