Browse Source

Don't crash when video is stopped and played again

(cherry picked from commit 5585bc1c3886b37f7188b357ddcdbc76ca46f42c)
Błażej Szczygieł 9 năm trước cách đây
mục cha
commit
d613952300
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      scene/gui/video_player.cpp

+ 2 - 1
scene/gui/video_player.cpp

@@ -248,7 +248,7 @@ void VideoPlayer::stop() {
 
 	playback->stop();
 	AudioServer::get_singleton()->stream_set_active(stream_rid,false);
-	resampler.clear();
+	resampler.flush();
 	set_process(false);
 	last_audio_time=0;
 };
@@ -426,5 +426,6 @@ VideoPlayer::~VideoPlayer() {
 
 	if (stream_rid.is_valid())
 		AudioServer::get_singleton()->free(stream_rid);
+	resampler.clear(); //Not necessary here, but make in consistent with other "stream_player" classes
 };