Skip to content

Commit

Permalink
Improve reading of faulty DVD SUP files - thx GCRaistlin :)
Browse files Browse the repository at this point in the history
  • Loading branch information
niksedk committed May 1, 2020
1 parent e488e82 commit c38918f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
* Add Arabic no-break-after list - thx OmrSi
* Titlebar changed to: "*file - SE" - thx Signy13/GCRaistlin
* Remove default alignment in TTML 1.0 - thx Arjan
* Improve reading of faulty DVD SUP files - thx GCRaistlin
* FIXED:
* Fix extraction from MKV via drag-n-drop - thx ryvec/Symos404/uckthis
* Fix issue with line break in MS translate - thx cocowash
Expand Down
7 changes: 6 additions & 1 deletion src/Forms/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12066,7 +12066,7 @@ private bool LoadTextSTFromMatroska(MatroskaTrackInfo matroskaSubtitleInfo, Matr
{
_fileName = matroska.Path.Remove(matroska.Path.Length - 4) + GetCurrentSubtitleFormat().Extension;
}

SetTitle();
_fileDateTime = new DateTime();
_converted = true;
Expand Down Expand Up @@ -13253,6 +13253,11 @@ private void ImportAndOcrSpDvdSup(string fileName, bool showInTaskbar)

buffer = new byte[SpHeader.SpHeaderLength];
bytesRead = fs.Read(buffer, 0, buffer.Length);
while (bytesRead == buffer.Length && Encoding.ASCII.GetString(buffer, 0, 2) != "SP")
{
fs.Seek(fs.Position - buffer.Length + 1, SeekOrigin.Begin);
bytesRead = fs.Read(buffer, 0, buffer.Length);
}
header = new SpHeader(buffer);
}
}
Expand Down

0 comments on commit c38918f

Please sign in to comment.