summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/theoraplayer/src/TheoraVideoClip.cpp2
-rw-r--r--drivers/theoraplayer/video_stream_theoraplayer.cpp18
2 files changed, 15 insertions, 5 deletions
diff --git a/drivers/theoraplayer/src/TheoraVideoClip.cpp b/drivers/theoraplayer/src/TheoraVideoClip.cpp
index 3ee4b83370..b71319e6a1 100644
--- a/drivers/theoraplayer/src/TheoraVideoClip.cpp
+++ b/drivers/theoraplayer/src/TheoraVideoClip.cpp
@@ -75,7 +75,7 @@ TheoraVideoClip::~TheoraVideoClip()
if (mAudioInterface)
{
mAudioMutex->lock(); // ensure a thread isn't using this mutex
- memdelete(mAudioInterface); // notify audio interface it's time to call it a day
+ delete mAudioInterface; // notify audio interface it's time to call it a day
mAudioMutex ->unlock();
delete mAudioMutex;
}
diff --git a/drivers/theoraplayer/video_stream_theoraplayer.cpp b/drivers/theoraplayer/video_stream_theoraplayer.cpp
index 8cb393b79b..fdf612ff0f 100644
--- a/drivers/theoraplayer/video_stream_theoraplayer.cpp
+++ b/drivers/theoraplayer/video_stream_theoraplayer.cpp
@@ -240,6 +240,11 @@ public:
owner->setTimer(this);
};
+ void stop() {
+
+ stream->stop();
+ };
+
void update(float time_increase)
{
mTime = (float)(stream->get_total_wrote() / channels) / freq;
@@ -257,7 +262,7 @@ public:
TheoraAudioInterface* createInstance(TheoraVideoClip* owner, int nChannels, int freq) {
printf("************** creating audio output\n");
- TheoraAudioInterface* ta = memnew(TPAudioGodot(owner, nChannels, freq));
+ TheoraAudioInterface* ta = new TPAudioGodot(owner, nChannels, freq);
return ta;
};
};
@@ -267,13 +272,16 @@ static TPAudioGodotFactory* audio_factory = NULL;
void VideoStreamTheoraplayer::stop() {
playing = false;
- if (clip)
+ if (clip) {
+ clip->stop();
clip->seek(0);
+ };
};
void VideoStreamTheoraplayer::play() {
playing = true;
+ started = true;
};
bool VideoStreamTheoraplayer::is_playing() const {
@@ -452,12 +460,14 @@ void VideoStreamTheoraplayer::set_file(const String& p_file) {
VideoStreamTheoraplayer::~VideoStreamTheoraplayer() {
- //if (mgr) {
+ stop();
+ //if (mgr) { // this should be a singleton or static or something
// memdelete(mgr);
//};
//mgr = NULL;
if (clip) {
- delete clip; // created by video manager with new
+ mgr->destroyVideoClip(clip);
+ clip = NULL;
};
};