Merge pull request #6634 from zaps166/fix-resampler-crash
Don't crash when video is stopped and played again
This commit is contained in:
commit
c939be8859
1 changed files with 2 additions and 1 deletions
|
@ -248,7 +248,7 @@ void VideoPlayer::stop() {
|
||||||
|
|
||||||
playback->stop();
|
playback->stop();
|
||||||
AudioServer::get_singleton()->stream_set_active(stream_rid,false);
|
AudioServer::get_singleton()->stream_set_active(stream_rid,false);
|
||||||
resampler.clear();
|
resampler.flush();
|
||||||
set_process(false);
|
set_process(false);
|
||||||
last_audio_time=0;
|
last_audio_time=0;
|
||||||
};
|
};
|
||||||
|
@ -426,5 +426,6 @@ VideoPlayer::~VideoPlayer() {
|
||||||
|
|
||||||
if (stream_rid.is_valid())
|
if (stream_rid.is_valid())
|
||||||
AudioServer::get_singleton()->free(stream_rid);
|
AudioServer::get_singleton()->free(stream_rid);
|
||||||
|
resampler.clear(); //Not necessary here, but make in consistent with other "stream_player" classes
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue