This commit is contained in:
Nikolaj Olsson 2017-07-23 10:53:25 +02:00
parent 36612752d9
commit 95b611a609

View File

@ -7,20 +7,11 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
{
public class CaptionsInc : SubtitleFormat
{
public override string Extension
{
get { return ".cin"; }
}
public override string Extension => ".cin";
public override string Name
{
get { return "Caption Inc"; }
}
public override string Name => "Caption Inc";
public override bool IsTimeBased
{
get { return true; }
}
public override bool IsTimeBased => true;
public static void Save(string fileName, Subtitle subtitle)
{
@ -36,7 +27,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
WriteTime(fs, subtitle.Paragraphs[0].StartTime, false); // first start time
WriteTime(fs, subtitle.Paragraphs[subtitle.Paragraphs.Count - 1].EndTime, false); // last end time
buffer = Encoding.ASCII.GetBytes("Generic Unknown Unknown \"\" Unknown Unknown Unknown ");
buffer = Encoding.ASCII.GetBytes("Generic Unknown Unknown \"\" Unknown Unknown Unknown".PadRight(230, ' '));
fs.Write(buffer, 0, buffer.Length);
// paragraphs
@ -191,7 +182,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
textEnd = true;
else if (buffer[i] <= 0x17)
{
if (!sb.ToString().EndsWith(Environment.NewLine))
if (!sb.ToString().EndsWith(Environment.NewLine, StringComparison.Ordinal))
sb.Append(Environment.NewLine);
i++;
}