summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-01-07 17:06:22 +0100
committerGitHub <noreply@github.com>2018-01-07 17:06:22 +0100
commit380169e3efb959cfeaa3884a3cd440ab84bff9ae (patch)
tree56ec4d4a9e52cc4dce3570c12874ecb21dcd3062 /scene/gui
parent1b098e646625b76b732b177f061af20bc41d2bbb (diff)
parent6fc1801b6ab2723dee4b1815d2d41a8215bbf98d (diff)
Merge pull request #15446 from marcelofg55/video_mix_rate
Fix Video Player issue with audio mix_rate when different than 44100
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/video_player.cpp8
-rw-r--r--scene/gui/video_player.h2
2 files changed, 1 insertions, 9 deletions
diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp
index 953ebe84f6..b0739a2f37 100644
--- a/scene/gui/video_player.cpp
+++ b/scene/gui/video_player.cpp
@@ -38,11 +38,6 @@ int VideoPlayer::sp_get_channel_count() const {
return playback->get_channels();
}
-void VideoPlayer::sp_set_mix_rate(int p_rate) {
-
- server_mix_rate = p_rate;
-}
-
bool VideoPlayer::mix(AudioFrame *p_buffer, int p_frames) {
// Check the amount resampler can really handle.
@@ -241,7 +236,7 @@ void VideoPlayer::set_stream(const Ref<VideoStream> &p_stream) {
AudioServer::get_singleton()->lock();
if (channels > 0)
- resampler.setup(channels, playback->get_mix_rate(), server_mix_rate, buffering_ms, 0);
+ resampler.setup(channels, playback->get_mix_rate(), AudioServer::get_singleton()->get_mix_rate(), buffering_ms, 0);
else
resampler.clear();
AudioServer::get_singleton()->unlock();
@@ -494,7 +489,6 @@ VideoPlayer::VideoPlayer() {
bus_index = 0;
buffering_ms = 500;
- server_mix_rate = 44100;
// internal_stream.player=this;
// stream_rid=AudioServer::get_singleton()->audio_stream_create(&internal_stream);
diff --git a/scene/gui/video_player.h b/scene/gui/video_player.h
index 7010c71ad9..5c379b5620 100644
--- a/scene/gui/video_player.h
+++ b/scene/gui/video_player.h
@@ -50,7 +50,6 @@ class VideoPlayer : public Control {
Ref<VideoStream> stream;
int sp_get_channel_count() const;
- void sp_set_mix_rate(int p_rate); //notify the stream of the mix rate
bool mix(AudioFrame *p_buffer, int p_frames);
RID stream_rid;
@@ -69,7 +68,6 @@ class VideoPlayer : public Control {
bool expand;
bool loops;
int buffering_ms;
- int server_mix_rate;
int audio_track;
int bus_index;