Video will now load without an available subtitles provider.

Originally committed to SVN as r880.
This commit is contained in:
Rodrigo Braz Monteiro 2007-01-23 00:38:59 +00:00
parent 99e9dce99f
commit 52060ceb03
2 changed files with 8 additions and 4 deletions

View file

@ -247,11 +247,15 @@ void VideoContext::SetVideo(const wxString &filename) {
// Choose a provider
provider = VideoProviderFactory::GetProvider(filename,overFps);
loaded = provider != NULL;
// Get subtitles provider
subsProvider = provider->GetAsSubtitlesProvider();
if (!subsProvider) subsProvider = SubtitlesProviderFactory::GetProvider();
loaded = provider != NULL;
try {
subsProvider = provider->GetAsSubtitlesProvider();
if (!subsProvider) subsProvider = SubtitlesProviderFactory::GetProvider();
}
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
fps = provider->GetFPS();

View file

@ -99,7 +99,7 @@ void VideoProvider::Cache(int n,const AegiVideoFrame frame) {
// Cache enabled?
if (cacheMax == 0) return;
// Cache full, remove use frame at front
// Cache full, use frame at front
if (cache.size() >= cacheMax) {
cache.push_back(cache.front());
cache.pop_front();