Merge pull request #5224 from zaps166/2.0-fix-theora-no-audio
Fix Theora video playback without a Vorbis stream
This commit is contained in:
commit
ff91f409bf
|
@ -513,7 +513,7 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool frame_done=false;
|
bool frame_done=false;
|
||||||
bool audio_done=false;
|
bool audio_done=!vorbis_p;
|
||||||
|
|
||||||
bool theora_done=false;
|
bool theora_done=false;
|
||||||
|
|
||||||
|
|
|
@ -208,10 +208,17 @@ void VideoPlayer::set_stream(const Ref<VideoStream> &p_stream) {
|
||||||
playback->set_paused(paused);
|
playback->set_paused(paused);
|
||||||
texture=playback->get_texture();
|
texture=playback->get_texture();
|
||||||
|
|
||||||
|
const int channels = playback->get_channels();
|
||||||
|
|
||||||
AudioServer::get_singleton()->lock();
|
AudioServer::get_singleton()->lock();
|
||||||
resampler.setup(playback->get_channels(),playback->get_mix_rate(),server_mix_rate,buffering_ms,0);
|
if (channels > 0)
|
||||||
|
resampler.setup(channels,playback->get_mix_rate(),server_mix_rate,buffering_ms,0);
|
||||||
|
else
|
||||||
|
resampler.clear();
|
||||||
AudioServer::get_singleton()->unlock();
|
AudioServer::get_singleton()->unlock();
|
||||||
playback->set_mix_callback(_audio_mix_callback,this);
|
|
||||||
|
if (channels > 0)
|
||||||
|
playback->set_mix_callback(_audio_mix_callback,this);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
texture.unref();
|
texture.unref();
|
||||||
|
|
Loading…
Reference in New Issue