[gnome-subtitles] Support buggy SubRip files that use dot instead of comma (fixes #642674)
- From: Pedro Daniel da Rocha Melo e Castro <pcastro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-subtitles] Support buggy SubRip files that use dot instead of comma (fixes #642674)
- Date: Sun, 20 Feb 2011 13:46:06 +0000 (UTC)
commit a74b860e409fe42cdf48431e78a5b8b26a662f26
Author: Pedro Castro <mail pedrocastro org>
Date: Sun Feb 20 13:45:47 2011 +0000
Support buggy SubRip files that use dot instead of comma (fixes #642674)
.../IO/SubtitleFormats/SubtitleFormatSubRip.cs | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/SubLib/IO/SubtitleFormats/SubtitleFormatSubRip.cs b/src/SubLib/IO/SubtitleFormats/SubtitleFormatSubRip.cs
index d2ee258..cc9b4f0 100644
--- a/src/SubLib/IO/SubtitleFormats/SubtitleFormatSubRip.cs
+++ b/src/SubLib/IO/SubtitleFormats/SubtitleFormatSubRip.cs
@@ -1,6 +1,6 @@
/*
* This file is part of SubLib.
- * Copyright (C) 2005-2009 Pedro Castro
+ * Copyright (C) 2005-2009,2011 Pedro Castro
*
* SubLib is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@ internal class SubtitleFormatSubRip : SubtitleFormat {
extensions = new string[] { "srt" };
lineBreak = "\n";
- format = @"\d+[ \f\r\t\v]*\n\d+(\s*:\s*\d+){2}\s*,\s*\d+\s*-->\s*\d+(\s*:\s*\d+){2}\s*,\d+[ \f\r\t\v]*\n.+";
+ format = @"\d+[ \f\r\t\v]*\n\d+(\s*:\s*\d+){2}\s*[,.]\s*\d+\s*-->\s*\d+(\s*:\s*\d+){2}\s*[,.]\d+[ \f\r\t\v]*\n.+"; //Dot is here to support buggy SubRip files
subtitleIn = @"(\d*[^\n]*\n)?((?<StartHours>\d+)[^\d\n]+)?(?<StartMinutes>\d+)[^\d\n]+(?<StartSeconds>\d+)([^\d\n](?<StartMilliseconds>\d+))?[^\d\n]+((?<EndHours>\d+)[^\d\n]+)?(?<EndMinutes>\d+)[^\d\n]+(?<EndSeconds>\d+)([^\d\n](?<EndMilliseconds>\d+))?[^\d\n]*(\n(?<Text>(.*(?!\n[ \f\r\t\v]*\d+[ \f\r\t\v]*\n\d+(\s*:\s*\d+){2})\n?)*.))?";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]