aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/fmv/movieplayer.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2010-08-31 09:45:21 +0000
committerEugene Sandulenko2010-10-12 23:22:01 +0000
commit384468c0148ede9ae8140b4fd75183368d26ada6 (patch)
tree22bc9e42fe955e1c869ffa05084d3e93fc335560 /engines/sword25/fmv/movieplayer.cpp
parentf71295ab6d6899b21809837b6c6bf317a45193ef (diff)
downloadscummvm-rg350-384468c0148ede9ae8140b4fd75183368d26ada6.tar.gz
scummvm-rg350-384468c0148ede9ae8140b4fd75183368d26ada6.tar.bz2
scummvm-rg350-384468c0148ede9ae8140b4fd75183368d26ada6.zip
SWORD25: Started to hook TheoraDecoder. Crashes at startup.
svn-id: r53297
Diffstat (limited to 'engines/sword25/fmv/movieplayer.cpp')
-rw-r--r--engines/sword25/fmv/movieplayer.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/engines/sword25/fmv/movieplayer.cpp b/engines/sword25/fmv/movieplayer.cpp
index e4b33bdf8c..3114d68bdc 100644
--- a/engines/sword25/fmv/movieplayer.cpp
+++ b/engines/sword25/fmv/movieplayer.cpp
@@ -33,6 +33,9 @@
*/
#include "sword25/fmv/movieplayer.h"
+#include "sword25/fmv/theora_decoder.h"
+#include "sword25/kernel/kernel.h"
+#include "sword25/package/packagemanager.h"
namespace Sword25 {
@@ -47,13 +50,29 @@ MoviePlayer::MoviePlayer(Kernel *pKernel) : Service(pKernel) {
BS_LOG_ERRORLN("Script bindings could not be registered.");
else
BS_LOGLN("Script bindings registered.");
+
+ _decoder = new TheoraDecoder();
}
-bool MoviePlayer::LoadMovie(const Common::String &Filename, unsigned int Z) {
+bool MoviePlayer::LoadMovie(const Common::String &filename, unsigned int Z) {
+ Common::SeekableReadStream *in = Kernel::GetInstance()->GetPackage()->GetStream(filename);
+
+ if (!in) {
+ BS_LOG_ERRORLN("Could not open movie file \"%s\".", filename.c_str());
+ return false;
+ }
+
+ if (!_decoder->load(in)) {
+ BS_LOG_ERRORLN("Could not load movie file \"%s\".", filename.c_str());
+ return false;
+ }
+
return true;
}
bool MoviePlayer::UnloadMovie() {
+ _decoder->close();
+
return true;
}