diff --git a/jenkins/create_build.sh b/jenkins/create_build.sh index 95c148b..d96f108 100755 --- a/jenkins/create_build.sh +++ b/jenkins/create_build.sh @@ -123,4 +123,4 @@ function deploy_client() { #compile_scripts #compile_native package_client -deploy_client +#deploy_client diff --git a/modules/core/ui-loader/graphical.ts b/modules/core/ui-loader/graphical.ts index 24717ef..01caa96 100644 --- a/modules/core/ui-loader/graphical.ts +++ b/modules/core/ui-loader/graphical.ts @@ -86,8 +86,8 @@ export namespace ui { const WINDOW_HEIGHT = 400 + (process.platform == "win32" ? 40 : 0); let bounds = screen.getPrimaryDisplay().bounds; - let x = bounds.x + (bounds.width - WINDOW_WIDTH) / 2; - let y = bounds.y + (bounds.height - WINDOW_HEIGHT) / 2; + let x = (bounds.x | 0) + ((bounds.width | 0) - WINDOW_WIDTH) / 2; + let y = (bounds.y | 0) + ((bounds.height | 0) - WINDOW_HEIGHT) / 2; gui = new electron.BrowserWindow({ width: WINDOW_WIDTH, diff --git a/modules/core/ui-loader/loader.ts b/modules/core/ui-loader/loader.ts index 6b3e680..0154635 100644 --- a/modules/core/ui-loader/loader.ts +++ b/modules/core/ui-loader/loader.ts @@ -507,7 +507,7 @@ async function load_cached_or_remote_ui_pack(channel: string, stats_update: (mes } } else if(remote_version.timestamp <= newest_local_version && !ignore_new_version_timestamp) { /* We've already a equal or newer version. Don't use the remote version */ - remote_version_dropped = remote_version.timestamp > bundles_ui ? bundles_ui.download_timestamp : 0; /* if remote is older than current bundled version its def. not a drop */ + remote_version_dropped = !!bundles_ui && remote_version.timestamp > bundles_ui.download_timestamp; /* if remote is older than current bundled version its def. not a drop */ } else { /* update is possible because the timestamp is newer than out latest local version */ try { diff --git a/modules/renderer/audio/AudioRecorder.ts b/modules/renderer/audio/AudioRecorder.ts index 40d1e61..165761b 100644 --- a/modules/renderer/audio/AudioRecorder.ts +++ b/modules/renderer/audio/AudioRecorder.ts @@ -56,9 +56,10 @@ namespace filters { } export class NThresholdFilter extends NativeFilter implements filter.ThresholdFilter { + static readonly frames_per_second = 1 / (960 / 48000); private filter: audio.record.ThresholdConsumeFilter; - private _margin_frames: number = 6; /* 120ms */ + private _margin_frames: number = 25; /* 120ms */ private _threshold: number = 50; private _callback_level: any; @@ -87,7 +88,7 @@ namespace filters { } get_margin_frames(): number { - return this.filter ? this.filter.get_margin_frames() : this._margin_frames; + return this.filter ? this.filter.get_margin_time() * NThresholdFilter.frames_per_second : this._margin_frames; } get_threshold(): number { @@ -97,7 +98,7 @@ namespace filters { set_margin_frames(value: number) { this._margin_frames = value; if(this.filter) - this.filter.set_margin_frames(value); + this.filter.set_margin_time(value / 960 / 1000); } get_attack_smooth(): number { @@ -145,7 +146,7 @@ namespace filters { this.filter = this.handle.consumer.create_filter_threshold(this._threshold); if(this._callback_level) this.filter.set_analyze_filter(this._callback_level); - this.filter.set_margin_frames(this._margin_frames); + this.filter.set_margin_time(this._margin_frames / NThresholdFilter.frames_per_second); this.filter.set_attack_smooth(this._attack_smooth); this.filter.set_release_smooth(this._release_smooth); } @@ -190,9 +191,10 @@ namespace filters { } export class NVoiceLevelFilter extends NativeFilter implements filter.VoiceLevelFilter { + static readonly frames_per_second = 1 / (960 / 48000); private filter: audio.record.VADConsumeFilter; private level = 3; - private _margin_frames = 5; + private _margin_frames = 6; constructor(handle) { super(handle, filter.Type.VOICE_LEVEL); @@ -212,7 +214,7 @@ namespace filters { this.finalize(); this.filter = this.handle.consumer.create_filter_vad(this.level); - this.filter.set_margin_frames(this._margin_frames); + this.filter.set_margin_time(this._margin_frames / NVoiceLevelFilter.frames_per_second); } get_level(): number { @@ -233,11 +235,11 @@ namespace filters { set_margin_frames(value: number) { this._margin_frames = value; if(this.filter) - this.filter.set_margin_frames(value); + this.filter.set_margin_time(value / NVoiceLevelFilter.frames_per_second); } get_margin_frames(): number { - return this.filter ? this.filter.get_margin_frames() : this._margin_frames; + return this.filter ? this.filter.get_margin_time() * NVoiceLevelFilter.frames_per_second : this._margin_frames; } } } diff --git a/native/serverconnection/src/connection/ProtocolHandler.cpp b/native/serverconnection/src/connection/ProtocolHandler.cpp index 4598aae..0ee7d1e 100644 --- a/native/serverconnection/src/connection/ProtocolHandler.cpp +++ b/native/serverconnection/src/connection/ProtocolHandler.cpp @@ -128,7 +128,7 @@ void ProtocolHandler::execute_resend() { if(this->connection_state >= connection_state::DISCONNECTED) return; - deque buffers; + std::deque> buffers; auto now = system_clock::now(); system_clock::time_point next = now + seconds(5); /* in real we're doing it all 500ms */ string error; @@ -146,7 +146,7 @@ void ProtocolHandler::execute_resend() { auto socket = this->handle->get_socket(); if(socket) { for(const auto& buffer : buffers) - socket->send_message(buffer); + socket->send_message(buffer->buffer); } this->handle->schedule_resend(next); diff --git a/native/serverconnection/src/connection/ProtocolHandlerPackets.cpp b/native/serverconnection/src/connection/ProtocolHandlerPackets.cpp index a4c356e..be99b70 100644 --- a/native/serverconnection/src/connection/ProtocolHandlerPackets.cpp +++ b/native/serverconnection/src/connection/ProtocolHandlerPackets.cpp @@ -17,9 +17,12 @@ using namespace ts; //#define LOG_PING void ProtocolHandler::handlePacketAck(const std::shared_ptr &ack) { + if(ack->data().length() < 2) return; + string error; + auto id = be2le16(&ack->data()[0]); //log_trace(category::connection, tr("Handle packet acknowledge for {}"), be2le16(&ack->data()[0])); - if(!this->acknowledge_handler.process_acknowledge(ack->type().type(), ack->data(), error)) { + if(!this->acknowledge_handler.process_acknowledge(ack->type().type(), id, error)) { log_warn(category::connection, tr("Failed to handle acknowledge {}: {}"), be2le16(&ack->data()[0]) ,error); } }