mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 11:12:36 +01:00
Fix .ts crash + better support for the ".tts" video ext - thx hepalin :)
This commit is contained in:
parent
6c2053c0d5
commit
8d33ff3aad
@ -29,7 +29,7 @@ namespace Nikse.SubtitleEdit.Core.Common
|
||||
private static readonly Regex RegexIsEpisodeNumber = new Regex("^\\d+x\\d+$", RegexOptions.Compiled);
|
||||
private static readonly Regex RegexNumberSpacePeriod = new Regex(@"(\d) (\.)", RegexOptions.Compiled);
|
||||
|
||||
public static string[] VideoFileExtensions { get; } = { ".avi", ".mkv", ".wmv", ".mpg", ".mpeg", ".divx", ".mp4", ".asf", ".flv", ".mov", ".m4v", ".vob", ".ogv", ".webm", ".ts", ".m2ts", ".mts", ".avs", ".mxf" };
|
||||
public static string[] VideoFileExtensions { get; } = { ".avi", ".mkv", ".wmv", ".mpg", ".mpeg", ".divx", ".mp4", ".asf", ".flv", ".mov", ".m4v", ".vob", ".ogv", ".webm", ".ts", ".tts", ".m2ts", ".mts", ".avs", ".mxf" };
|
||||
public static string[] AudioFileExtensions { get; } = { ".mp3", ".wav", ".wma", ".ogg", ".mpa", ".m4a", ".ape", ".aiff", ".flac", ".aac", ".ac3", ".eac3", ".mka" };
|
||||
|
||||
public static bool IsInteger(string s)
|
||||
@ -1731,10 +1731,10 @@ namespace Nikse.SubtitleEdit.Core.Common
|
||||
|
||||
public static Color GetColorFromAssa(string text, Color defaultColor)
|
||||
{
|
||||
var start = text.IndexOf(@"\c");
|
||||
var start = text.IndexOf(@"\c", StringComparison.Ordinal);
|
||||
if (start < 0)
|
||||
{
|
||||
start = text.IndexOf(@"\1c");
|
||||
start = text.IndexOf(@"\1c", StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
if (start < 0 || text.Substring(start).StartsWith(@"\clip", StringComparison.Ordinal))
|
||||
|
@ -580,6 +580,11 @@ namespace Nikse.SubtitleEdit.Core.ContainerFormats.TransportStream
|
||||
|
||||
public void WriteToStream(Stream stream)
|
||||
{
|
||||
if (_dataBuffer == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
stream.Write(_dataBuffer, 0, _dataBuffer.Length);
|
||||
}
|
||||
}
|
||||
|
@ -2836,7 +2836,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
return;
|
||||
}
|
||||
|
||||
if ((ext == ".ts" || ext == ".rec" || ext == ".mpeg" || ext == ".mpg") && file.Length > 10000 && FileUtil.IsTransportStream(fileName))
|
||||
if ((ext == ".ts" || ext == ".tts" || ext == ".rec" || ext == ".mpeg" || ext == ".mpg") && file.Length > 10000 && FileUtil.IsTransportStream(fileName))
|
||||
{
|
||||
ImportSubtitleFromTransportStream(fileName);
|
||||
return;
|
||||
@ -2854,7 +2854,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
if (((ext == ".m2ts" || ext == ".ts" || ext == ".mts") && file.Length > 10000 && FileUtil.IsM2TransportStream(fileName)) ||
|
||||
if (((ext == ".m2ts" || ext == ".ts" || ext == ".tts" || ext == ".mts") && file.Length > 10000 && FileUtil.IsM2TransportStream(fileName)) ||
|
||||
(ext == ".textst" && FileUtil.IsMpeg2PrivateStream2(fileName)))
|
||||
{
|
||||
bool isTextSt = false;
|
||||
@ -15421,11 +15421,11 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
OpenSubtitle(fileName, null);
|
||||
}
|
||||
else if ((ext == ".ts" || ext == ".rec" || ext == ".mpg" || ext == ".mpeg") && FileUtil.IsTransportStream(fileName))
|
||||
else if ((ext == ".ts" || ext == ".tts" || ext == ".rec" || ext == ".mpg" || ext == ".mpeg") && FileUtil.IsTransportStream(fileName))
|
||||
{
|
||||
OpenSubtitle(fileName, null);
|
||||
}
|
||||
else if ((ext == ".m2ts" || ext == ".ts" || ext == ".mts") && FileUtil.IsM2TransportStream(fileName))
|
||||
else if ((ext == ".m2ts" || ext == ".ts" || ext == ".tts" || ext == ".mts") && FileUtil.IsM2TransportStream(fileName))
|
||||
{
|
||||
OpenSubtitle(fileName, null);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user