mirror of https://github.com/odrling/Aegisub
Video will now load without an available subtitles provider.
Originally committed to SVN as r880.
This commit is contained in:
parent
99e9dce99f
commit
52060ceb03
|
@ -247,11 +247,15 @@ void VideoContext::SetVideo(const wxString &filename) {
|
||||||
|
|
||||||
// Choose a provider
|
// Choose a provider
|
||||||
provider = VideoProviderFactory::GetProvider(filename,overFps);
|
provider = VideoProviderFactory::GetProvider(filename,overFps);
|
||||||
|
loaded = provider != NULL;
|
||||||
|
|
||||||
// Get subtitles provider
|
// Get subtitles provider
|
||||||
|
try {
|
||||||
subsProvider = provider->GetAsSubtitlesProvider();
|
subsProvider = provider->GetAsSubtitlesProvider();
|
||||||
if (!subsProvider) subsProvider = SubtitlesProviderFactory::GetProvider();
|
if (!subsProvider) subsProvider = SubtitlesProviderFactory::GetProvider();
|
||||||
loaded = provider != NULL;
|
}
|
||||||
|
catch (wxString err) { wxMessageBox(_T("Error while loading subtitles provider: ") + err,_T("Subtitles provider")); }
|
||||||
|
catch (const wchar_t *err) { wxMessageBox(_T("Error while loading subtitles provider: ") + wxString(err),_T("Subtitles provider")); }
|
||||||
|
|
||||||
// Set frame rate
|
// Set frame rate
|
||||||
fps = provider->GetFPS();
|
fps = provider->GetFPS();
|
||||||
|
|
|
@ -99,7 +99,7 @@ void VideoProvider::Cache(int n,const AegiVideoFrame frame) {
|
||||||
// Cache enabled?
|
// Cache enabled?
|
||||||
if (cacheMax == 0) return;
|
if (cacheMax == 0) return;
|
||||||
|
|
||||||
// Cache full, remove use frame at front
|
// Cache full, use frame at front
|
||||||
if (cache.size() >= cacheMax) {
|
if (cache.size() >= cacheMax) {
|
||||||
cache.push_back(cache.front());
|
cache.push_back(cache.front());
|
||||||
cache.pop_front();
|
cache.pop_front();
|
||||||
|
|
Loading…
Reference in New Issue