mirror of https://github.com/odrling/Aegisub
properly detect missing subtitle provider
Originally committed to SVN as r376.
This commit is contained in:
parent
a850859d08
commit
04e8ef1cd9
|
@ -50,6 +50,12 @@ SubtitleProvider::Class::Class(wxString name)
|
|||
|
||||
SubtitleProvider *SubtitleProvider::Class::GetProvider(wxString provider_name, AssFile *subs)
|
||||
{
|
||||
return (*classes)[provider_name]->Get(subs);
|
||||
SubtitleProvider::Class *sp;
|
||||
if (!classes)
|
||||
throw _T("Subtitle provider not found");
|
||||
sp = (*classes)[provider_name];
|
||||
if (!sp)
|
||||
throw _T("Subtitle provider not found");
|
||||
return sp->Get(subs);
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,11 @@ LAVCVideoProvider::LAVCVideoProvider(wxString filename, wxString subfilename) {
|
|||
LoadVideo(filename);
|
||||
|
||||
// Attach subtitles
|
||||
try {
|
||||
SubtitleProvider::Class::GetProvider(_T("asa"), AssFile::top)->Bind(this);
|
||||
} catch (...) {
|
||||
/* warn user? */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue