Skip to content

Commit

Permalink
VIDEO: Use ScopedPtr in the ActImagine VX decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Oct 26, 2016
1 parent 2abb7eb commit 91a0af7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
15 changes: 1 addition & 14 deletions src/video/actimagine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,10 @@ namespace Video {
ActimagineDecoder::ActimagineDecoder(Common::SeekableReadStream *vx) : _vx(vx) {
assert(_vx);

try {
load();
} catch (...) {
clear();
throw;
}
load();
}

ActimagineDecoder::~ActimagineDecoder() {
clear();
}

void ActimagineDecoder::clear() {
VideoDecoder::deinit();

delete _vx;
_vx = 0;
}

uint32 ActimagineDecoder::getTimeToNextFrame() const {
Expand Down
6 changes: 4 additions & 2 deletions src/video/actimagine.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#ifndef VIDEO_ACTIMAGINE_H
#define VIDEO_ACTIMAGINE_H

#include "src/common/types.h"
#include "src/common/scopedptr.h"

#include "src/video/decoder.h"

namespace Common {
Expand All @@ -46,11 +49,10 @@ class ActimagineDecoder : public VideoDecoder {
void processData();

private:
Common::SeekableReadStream *_vx;
Common::ScopedPtr<Common::SeekableReadStream> _vx;

/** Load an Actimagine file. */
void load();
void clear();
};

} // End of namespace Video
Expand Down

0 comments on commit 91a0af7

Please sign in to comment.