From 7ba484bc7499a58635cc061b318d003c5f8c371f Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 6 Dec 2015 20:22:45 -0300 Subject: [PATCH] some fixes -fix compilation on tres/tscn on MSVC -fixed theora playback performance, closes #3004 --- core/io/resource_format_binary.cpp | 2 +- drivers/theora/video_stream_theora.cpp | 2 +- drivers/theora/video_stream_theora.h | 6 +++--- platform/windows/detect.py | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 1a0552e8d12..4cd3cd595fe 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -905,7 +905,7 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) { error=ERR_FILE_UNRECOGNIZED; ERR_EXPLAIN("Unrecognized binary resource file: "+local_path); - ERR_FAIL_V(); + ERR_FAIL(); } bool big_endian = f->get_32(); diff --git a/drivers/theora/video_stream_theora.cpp b/drivers/theora/video_stream_theora.cpp index 01b6f4d35ed..fe248bc9113 100644 --- a/drivers/theora/video_stream_theora.cpp +++ b/drivers/theora/video_stream_theora.cpp @@ -411,6 +411,7 @@ void VideoStreamPlaybackTheora::set_file(const String& p_file) { th_decode_ctl(td,TH_DECCTL_GET_PPLEVEL_MAX,&pp_level_max, sizeof(pp_level_max)); pp_level=pp_level_max; + pp_level=0; th_decode_ctl(td,TH_DECCTL_SET_PPLEVEL,&pp_level,sizeof(pp_level)); pp_inc=0; @@ -620,7 +621,6 @@ void VideoStreamPlaybackTheora::update(float p_delta) { if(videobuf_time>=get_time()) { frame_done=true; - } else{ /*If we are too slow, reduce the pp level.*/ pp_inc=pp_level>0?-1:0; diff --git a/drivers/theora/video_stream_theora.h b/drivers/theora/video_stream_theora.h index 3d88ba4e4b6..c15ef31cfcf 100644 --- a/drivers/theora/video_stream_theora.h +++ b/drivers/theora/video_stream_theora.h @@ -138,20 +138,20 @@ class VideoStreamTheora : public VideoStream { OBJ_TYPE(VideoStreamTheora,VideoStream); String file; - int audio_track; + int audio_track; public: Ref instance_playback() { Ref pb = memnew( VideoStreamPlaybackTheora ); - pb->set_audio_track(audio_track); + pb->set_audio_track(audio_track); pb->set_file(file); return pb; } void set_file(const String& p_file) { file=p_file; } - void set_audio_track(int p_track) { audio_track=p_track; } + void set_audio_track(int p_track) { audio_track=p_track; } VideoStreamTheora() { audio_track=0; } diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 4ec4b054dbf..3193a2acbbe 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -170,7 +170,6 @@ def get_flags(): return [ ('freetype','builtin'), #use builtin freetype ('openssl','builtin'), #use builtin openssl - ('theora','no'), ] def build_res_file( target, source, env ):