mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 21:59:17 +00:00
DRAGONS: Free video decoder and handle failure to load video file
This commit is contained in:
parent
529af3837c
commit
bbe0b262e5
@ -32,7 +32,10 @@ StrPlayer::StrPlayer(DragonsEngine *vm, Screen *screen) : _vm(vm), _screen(scree
|
||||
|
||||
void StrPlayer::playVideo(const Common::String &filename) {
|
||||
bool skipped = false;
|
||||
_decoder->loadFile(filename);
|
||||
|
||||
if (!_decoder->loadFile(filename)) {
|
||||
error("Error playing video from %s", filename.c_str());
|
||||
}
|
||||
_decoder->start();
|
||||
|
||||
while (!_vm->shouldQuit() && !_decoder->endOfVideo() && !skipped) {
|
||||
@ -57,4 +60,8 @@ void StrPlayer::playVideo(const Common::String &filename) {
|
||||
_decoder->close();
|
||||
}
|
||||
|
||||
StrPlayer::~StrPlayer() {
|
||||
delete _decoder;
|
||||
}
|
||||
|
||||
} // End of namespace Dragons
|
||||
|
@ -35,6 +35,7 @@ private:
|
||||
Video::VideoDecoder *_decoder;
|
||||
public:
|
||||
StrPlayer(DragonsEngine *vm, Screen *screen);
|
||||
~StrPlayer();
|
||||
|
||||
void playVideo(const Common::String &filename);
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user