check parsed floats for NaN in media info providers
This commit is contained in:
parent
40501ac1f3
commit
1b47be2d1f
|
@ -201,7 +201,7 @@
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="MediaInfo\ffmpeg20130310.zip" />
|
<EmbeddedResource Include="MediaInfo\ffmpeg20130312.zip" />
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
a005e50576665b191cbd02b42d6260bffb764690
|
|
|
@ -0,0 +1 @@
|
||||||
|
629771e1793534eea1b867e8333f22a829acc35f
|
|
@ -262,11 +262,15 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
|
||||||
{
|
{
|
||||||
var parts = value.Split('/');
|
var parts = value.Split('/');
|
||||||
|
|
||||||
|
float result;
|
||||||
|
|
||||||
if (parts.Length == 2)
|
if (parts.Length == 2)
|
||||||
{
|
{
|
||||||
return float.Parse(parts[0]) / float.Parse(parts[1]);
|
result = float.Parse(parts[0]) / float.Parse(parts[1]);
|
||||||
}
|
}
|
||||||
return float.Parse(parts[0]);
|
result = float.Parse(parts[0]);
|
||||||
|
|
||||||
|
return float.IsNaN(result) ? (float?)null : result;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user