majorsilence/MPlayerControl — pull request #8 by medo64 (2014-08-25 00:16:11+00:00)
Title: Fixed FormatException when nan/-nan is parsed.

Unfortunately Mono cannot parse nan unless it is exact literal "NaN". This code is workaround for this.

Example exception:
--
libGL error: pci id for fd 5: 80ee:beef, driver (null)
System.FormatException: Unknown char: n
at System.Double.Parse (System.String s, NumberStyles style, IFormatProvider provider) [0x00000] in :0
at System.Single.Parse (System.String s, IFormatProvider provider) [0x00000] in :0
at LibMPlayerCommon.Globals.FloatParse (System.String input) [0x00000] in :0
at LibMPlayerCommon.Discover..ctor (System.String filePath, System.String mplayerPath) [0x00000] in :0
at LibMPlayerCommon.MPlayer.LoadCurrentPlayingFileLength () [0x00000] in :0
at LibMPlayerCommon.MPlayer.LoadFile (System.String filePath) [0x00000] in :0
at LibMPlayerCommon.MPlayer.Play (System.String filePath) [0x00000] in :0
at Test.MainForm.m__0 (System.Object sender, System.EventArgs e) [0x00000] in :0
at System.Windows.Forms.Form.OnLoad (System.EventArgs e) [0x00000] in :0
at System.Windows.Forms.Form.OnLoadInternal (System.EventArgs e) [0x00000] in :0

Unhandled Exception:
System.ObjectDisposedException: The object was used after being disposed.
at System.Windows.Forms.Control.CreateHandle () [0x00000] in :0
at System.Windows.Forms.Form.CreateHandle () [0x00000] in :0
at System.Windows.Forms.Control.get_Handle () [0x00000] in :0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:get_Handle ()
at System.Windows.Forms.Form.SetVisibleCore (Boolean value) [0x00000] in :0
at System.Windows.Forms.Control.set_Visible (Boolean value) [0x00000] in :0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:set_Visible (bool)
at System.Windows.Forms.Application.RunLoop (Boolean Modal, System.Windows.Forms.ApplicationContext context) [0x00000] in :0
at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext context) [0x00000] in :0
at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm) [0x00000] in :0
at Test.App.Main (System.String[] args) [0x00000] in :0
[ERROR] FATAL UNHANDLED EXCEPTION: System.ObjectDisposedException: The object was used after being disposed.
at System.Windows.Forms.Control.CreateHandle () [0x00000] in :0
at System.Windows.Forms.Form.CreateHandle () [0x00000] in :0
at System.Windows.Forms.Control.get_Handle () [0x00000] in :0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:get_Handle ()
at System.Windows.Forms.Form.SetVisibleCore (Boolean value) [0x00000] in :0
at System.Windows.Forms.Control.set_Visible (Boolean value) [0x00000] in :0
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:set_Visible (bool)
at System.Windows.Forms.Application.RunLoop (Boolean Modal, System.Windows.Forms.ApplicationContext context) [0x00000] in :0
at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext context) [0x00000] in :0
at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm) [0x00000] in :0
at Test.App.Main (System.String[] args) [0x00000] in :0