[banshee] Mono.Media: Fix Xspf Playlist importing Error (bgo#650184) (LP#791418)
- From: Olivier Dufour <dufoli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] Mono.Media: Fix Xspf Playlist importing Error (bgo#650184) (LP#791418)
- Date: Thu, 18 Aug 2011 21:40:14 +0000 (UTC)
commit 2175157c8582c0e8cd9d64934fadd6adacf31495
Author: Johannes Koch <jkoch contact gmail com>
Date: Thu Aug 18 23:37:42 2011 +0200
Mono.Media: Fix Xspf Playlist importing Error (bgo#650184) (LP#791418)
This fix parses the date tag of an xspf file in the right way.
It converts the millisecond value regardless of culture into a short integer.
In some configurations the parser removed the leading point.
Therefore, the result was an high integer value,
which caused an ArgumentOutOfRangeException.
.../Mono.Media/Media.Playlists.Xspf/W3CDateTime.cs | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/Libraries/Mono.Media/Media.Playlists.Xspf/W3CDateTime.cs b/src/Libraries/Mono.Media/Media.Playlists.Xspf/W3CDateTime.cs
index be7b2d4..977c472 100644
--- a/src/Libraries/Mono.Media/Media.Playlists.Xspf/W3CDateTime.cs
+++ b/src/Libraries/Mono.Media/Media.Playlists.Xspf/W3CDateTime.cs
@@ -239,7 +239,8 @@ namespace Media.Playlists.Xspf
int hour = m.Groups["hour"].Success ? Int32.Parse(m.Groups["hour"].Value) : 0;
int min = m.Groups["min"].Success ? Int32.Parse(m.Groups["min"].Value) : 0;
int sec = m.Groups["sec"].Success ? Int32.Parse(m.Groups["sec"].Value) : 0;
- int ms = m.Groups["ms"].Success ? (int)Math.Round(1000 * Double.Parse(m.Groups["ms"].Value)) : 0;
+ int ms = m.Groups["ms"].Success ? (int)Math.Round(1000 * Double.Parse(m.Groups["ms"].Value,
+ System.Globalization.NumberFormatInfo.InvariantInfo)) : 0;
TimeSpan offset = TimeSpan.Zero;
if(m.Groups["ofs"].Success) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]