forked from teamnwah/openmw-tes3coop
Catch exception for not found videos
This commit is contained in:
parent
a73362f036
commit
842ff4d874
1 changed files with 12 additions and 1 deletions
|
@ -30,7 +30,18 @@ void VideoWidget::playVideo(const std::string &video)
|
|||
{
|
||||
mPlayer->setAudioFactory(new MWSound::MovieAudioFactory());
|
||||
|
||||
mPlayer->playVideo(mVFS->get(video), video);
|
||||
Files::IStreamPtr videoStream;
|
||||
try
|
||||
{
|
||||
videoStream = mVFS->get(video);
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
std::cerr << "Failed to open video: " << e.what() << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
mPlayer->playVideo(videoStream, video);
|
||||
|
||||
osg::ref_ptr<osg::Texture2D> texture = mPlayer->getVideoTexture();
|
||||
if (!texture)
|
||||
|
|
Loading…
Reference in a new issue