aboutsummaryrefslogtreecommitdiff
path: root/video/coktel_decoder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'video/coktel_decoder.cpp')
-rw-r--r--video/coktel_decoder.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/video/coktel_decoder.cpp b/video/coktel_decoder.cpp
index be36874db4..0c7ade1b8a 100644
--- a/video/coktel_decoder.cpp
+++ b/video/coktel_decoder.cpp
@@ -646,6 +646,21 @@ PreIMDDecoder::~PreIMDDecoder() {
close();
}
+bool PreIMDDecoder::reloadStream(Common::SeekableReadStream *stream) {
+ if (!_stream)
+ return false;
+
+ if (!stream->seek(_stream->pos())) {
+ close();
+ return false;
+ }
+
+ delete _stream;
+ _stream = stream;
+
+ return true;
+}
+
bool PreIMDDecoder::seek(int32 frame, int whence, bool restart) {
if (!evaluateSeekFrame(frame, whence))
return false;
@@ -840,6 +855,21 @@ IMDDecoder::~IMDDecoder() {
close();
}
+bool IMDDecoder::reloadStream(Common::SeekableReadStream *stream) {
+ if (!_stream)
+ return false;
+
+ if (!stream->seek(_stream->pos())) {
+ close();
+ return false;
+ }
+
+ delete _stream;
+ _stream = stream;
+
+ return true;
+}
+
bool IMDDecoder::seek(int32 frame, int whence, bool restart) {
if (!evaluateSeekFrame(frame, whence))
return false;
@@ -1536,6 +1566,21 @@ VMDDecoder::~VMDDecoder() {
close();
}
+bool VMDDecoder::reloadStream(Common::SeekableReadStream *stream) {
+ if (!_stream)
+ return false;
+
+ if (!stream->seek(_stream->pos())) {
+ close();
+ return false;
+ }
+
+ delete _stream;
+ _stream = stream;
+
+ return true;
+}
+
bool VMDDecoder::seek(int32 frame, int whence, bool restart) {
if (!evaluateSeekFrame(frame, whence))
return false;