From 053fa2931f779f703e13a7777f5701042954506d Mon Sep 17 00:00:00 2001 From: niksedk Date: Wed, 20 Jun 2012 19:08:40 +0000 Subject: [PATCH] Fixed bug in sami reading - thx josh :) git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@1266 99eadd0c-20b8-1223-b5c4-2a2b2df33de2 --- src/Logic/SubtitleFormats/Sami.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Logic/SubtitleFormats/Sami.cs b/src/Logic/SubtitleFormats/Sami.cs index afe9bd0b7..1a030aa79 100644 --- a/src/Logic/SubtitleFormats/Sami.cs +++ b/src/Logic/SubtitleFormats/Sami.cs @@ -133,9 +133,10 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats while (syncStartPos >= 0) { string millisecAsString = string.Empty; - while (index < allInput.Length && "0123456789".Contains(allInput[index].ToString())) + while (index < allInput.Length && "\"'0123456789".Contains(allInput[index].ToString())) { - millisecAsString += allInput[index]; + if (allInput[index] != '"' && allInput[index] != '\'') + millisecAsString += allInput[index]; index++; } @@ -210,7 +211,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats cleanText = cleanText.Replace(" ", string.Empty).Replace("&NBSP;", string.Empty); cleanText = cleanText.Trim(); - if (!string.IsNullOrEmpty(p.Text)) + if (!string.IsNullOrEmpty(p.Text) && !string.IsNullOrEmpty(millisecAsString)) { p.EndTime = new TimeCode(TimeSpan.FromMilliseconds(long.Parse(millisecAsString))); subtitle.Paragraphs.Add(p);