more fixes

This commit is contained in:
Juan Linietsky 2015-11-04 09:54:23 -03:00
parent 66e96e7a87
commit dde6396f22

View File

@ -196,10 +196,10 @@ void VideoPlayer::set_stream(const Ref<VideoStream> &p_stream) {
stream=p_stream;
if (stream.is_valid()) {
stream->set_audio_track(audio_track);
playback=stream->instance_playback();
stream->set_audio_track(audio_track);
playback=stream->instance_playback();
} else {
playback=Ref<VideoStreamPlayback>();
playback=Ref<VideoStreamPlayback>();
}
if (!playback.is_null()) {
@ -249,6 +249,8 @@ void VideoPlayer::stop() {
return;
playback->stop();
AudioServer::get_singleton()->stream_set_active(stream_rid,false);
resampler.clear();
set_process(false);
last_audio_time=0;
};
@ -387,8 +389,8 @@ void VideoPlayer::_bind_methods() {
ADD_PROPERTY( PropertyInfo(Variant::REAL, "stream/volume_db", PROPERTY_HINT_RANGE,"-80,24,0.01"), _SCS("set_volume_db"), _SCS("get_volume_db") );
ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/autoplay"), _SCS("set_autoplay"), _SCS("has_autoplay") );
ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/paused"), _SCS("set_paused"), _SCS("is_paused") );
ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/audio_track",PROPERTY_HINT_RANGE,"0,128,1"), _SCS("set_audio_track"), _SCS("get_audio_track") );
ADD_PROPERTY( PropertyInfo( Variant::BOOL, "expand" ), _SCS("set_expand"),_SCS("has_expand") );
ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/audio_track",PROPERTY_HINT_RANGE,"0,128,1"), _SCS("set_audio_track"), _SCS("get_audio_track") );
ADD_PROPERTY( PropertyInfo( Variant::BOOL, "expand" ), _SCS("set_expand"),_SCS("has_expand") );
}