diff options
author | randomengy <[email protected]> | 2013-08-23 03:06:23 +0000 |
---|---|---|
committer | randomengy <[email protected]> | 2013-08-23 03:06:23 +0000 |
commit | 1270ebc49fc8dc11ea509815094faacfa8338834 (patch) | |
tree | e6deed5b54b8c45f4efab2d42ce56f2579ec42cf /win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs | |
parent | bd8ccfa4473bdad2340a6a191d465f2252e62efe (diff) |
Interop: Updated some structs to keep up with libhb. Exposed video quality limits. Exposed libhb language list. Suppressed a non-fatal avformat seek error. Fixed localization error in video rates list. Fixed missing sample rate for encoder-specific passthroughs. Fixed "disabled" quality level.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5740 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs')
-rw-r--r-- | win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs index 42d200e57..1369b32c1 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs @@ -11,7 +11,8 @@ namespace HandBrake.Interop {
using System;
using System.Collections.Generic;
-
+ using System.Globalization;
+ using System.Runtime.InteropServices;
using HandBrake.Interop.HbLib;
using HandBrake.Interop.Model.Encoding;
using HandBrake.Interop.SourceData;
@@ -37,7 +38,7 @@ namespace HandBrake.Interop VideoRates = new Dictionary<double, int>();
foreach (var framerate in Encoders.VideoFramerates)
{
- VideoRates.Add(double.Parse(framerate.Name), framerate.Rate);
+ VideoRates.Add(double.Parse(framerate.Name, CultureInfo.InvariantCulture), framerate.Rate);
}
}
@@ -231,6 +232,23 @@ namespace HandBrake.Interop }
/// <summary>
+ /// Converts a native language structure to a Language object.
+ /// </summary>
+ /// <param name="language">The structure to convert.</param>
+ /// <returns>The converted structure.</returns>
+ public static Language NativeToLanguage(iso639_lang_t language)
+ {
+ string englishName = InteropUtilities.ReadUtf8Ptr(language.eng_name);
+ string nativeName = InteropUtilities.ReadUtf8Ptr(language.native_name);
+ return new Language
+ {
+ Code = language.iso639_2,
+ EnglishName = englishName,
+ NativeName = nativeName
+ };
+ }
+
+ /// <summary>
/// Converts the PTS amount to a TimeSpan. There may be some accuracy loss here.
/// </summary>
/// <param name="pts">The PTS to convert.</param>
|