mirror of https://github.com/odrling/Aegisub
Don't try to open compressed subtitle tracks
Actually supporting them would be even better of course, but at least don't crash on them.
This commit is contained in:
parent
c74045cf20
commit
aa850688f4
|
@ -187,7 +187,7 @@ void MatroskaWrapper::GetSubtitles(agi::fs::path const& filename, AssFile *targe
|
||||||
// Find tracks
|
// Find tracks
|
||||||
for (auto track : boost::irange(0u, tracks)) {
|
for (auto track : boost::irange(0u, tracks)) {
|
||||||
auto trackInfo = mkv_GetTrackInfo(file, track);
|
auto trackInfo = mkv_GetTrackInfo(file, track);
|
||||||
if (trackInfo->Type != 0x11) continue;
|
if (trackInfo->Type != 0x11 || trackInfo->CompEnabled) continue;
|
||||||
|
|
||||||
// Known subtitle format
|
// Known subtitle format
|
||||||
std::string CodecID(trackInfo->CodecID);
|
std::string CodecID(trackInfo->CodecID);
|
||||||
|
@ -265,7 +265,7 @@ bool MatroskaWrapper::HasSubtitles(agi::fs::path const& filename) {
|
||||||
for (auto track : boost::irange(0u, tracks)) {
|
for (auto track : boost::irange(0u, tracks)) {
|
||||||
auto trackInfo = mkv_GetTrackInfo(file, track);
|
auto trackInfo = mkv_GetTrackInfo(file, track);
|
||||||
|
|
||||||
if (trackInfo->Type == 0x11) {
|
if (trackInfo->Type == 0x11 && !trackInfo->CompEnabled) {
|
||||||
std::string CodecID(trackInfo->CodecID);
|
std::string CodecID(trackInfo->CodecID);
|
||||||
if (CodecID == "S_TEXT/SSA" || CodecID == "S_TEXT/ASS" || CodecID == "S_TEXT/UTF8")
|
if (CodecID == "S_TEXT/SSA" || CodecID == "S_TEXT/ASS" || CodecID == "S_TEXT/UTF8")
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue