Fix a bug in ebu stl subtitle format where the two first letters were skipped (thx Rumen)

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@320 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2011-02-07 20:08:26 +00:00
parent 049ef058a2
commit c4baaa211e

View File

@ -429,7 +429,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
byte[] buffer = ASCIIEncoding.ASCII.GetBytes(header.ToString()); byte[] buffer = ASCIIEncoding.ASCII.GetBytes(header.ToString());
fs.Write(buffer, 0, buffer.Length); fs.Write(buffer, 0, buffer.Length);
foreach (Paragraph p in subtitle.Paragraphs) foreach (Paragraph p in subtitle.Paragraphs)
{ {
EbuTextTimingInformation tti = new EbuTextTimingInformation(); EbuTextTimingInformation tti = new EbuTextTimingInformation();
@ -848,7 +847,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
for (int i = 0; i < 112; i++) // skip fist byte (seems to be always 0xd/32/space - thx Iban) for (int i = 0; i < 112; i++) // skip fist byte (seems to be always 0xd/32/space - thx Iban)
{ {
byte b = buffer[index + 16 + i]; byte b = buffer[index + 16 + i];
if (i == 0 || i == 2 | i == 3) if (i == 0 || (i == 2 && b < 0xf) | (i == 3 && b <= 0xf))
{ {
// not used, 0=0xd, 2=0xb, 3=0xb // not used, 0=0xd, 2=0xb, 3=0xb
} }