From 4cc03af9a9ef811f85ffc0ec17351adcf589a7f8 Mon Sep 17 00:00:00 2001 From: sirius Date: Sat, 2 Nov 2019 18:32:48 +0800 Subject: [PATCH] remove useless functions for previous audio sync --- src/engine/client/video.h | 2 -- src/engine/shared/demo.cpp | 4 ---- src/engine/shared/video.h | 4 ---- 3 files changed, 10 deletions(-) diff --git a/src/engine/client/video.h b/src/engine/client/video.h index 9b1d2014e..7e69070d8 100644 --- a/src/engine/client/video.h +++ b/src/engine/client/video.h @@ -71,8 +71,6 @@ public: static void Init() { av_log_set_level(AV_LOG_DEBUG); avcodec_register_all(); av_register_all(); } - bool GetSync() { if(m_Recording) return (double)(m_vframe/m_FPS) <= m_AudioStream.enc->frame_number*m_AudioStream.enc->frame_size/m_AudioStream.enc->sample_rate; } - private: void fill_video_frame(); void read_rgb_from_gl(); diff --git a/src/engine/shared/demo.cpp b/src/engine/shared/demo.cpp index 6f9cbe328..45848ba89 100644 --- a/src/engine/shared/demo.cpp +++ b/src/engine/shared/demo.cpp @@ -932,10 +932,6 @@ int CDemoPlayer::Update(bool RealTime) break; // do one more tick -#if defined(CONF_VIDEORECORDER) - if(IVideo::Current()) - IVideo::Current()->SetBreak((double)m_Info.m_Info.m_Speed); -#endif DoTick(); if(m_Info.m_Info.m_Paused) diff --git a/src/engine/shared/video.h b/src/engine/shared/video.h index 416a3921b..c47093b90 100644 --- a/src/engine/shared/video.h +++ b/src/engine/shared/video.h @@ -17,7 +17,6 @@ public: virtual void nextAudioFrame(void (*Mix)(short *pFinalOut, unsigned Frames)) = 0; virtual void nextAudioFrame_timeline() = 0; - virtual bool GetSync() = 0; static IVideo* Current() { return ms_pCurrentVideo; } @@ -27,9 +26,6 @@ public: static void SetLocalStartTime(int64 LocalStartTime) { ms_LocalStartTime = LocalStartTime; } static void SetFPS(int fps) { ms_TickTime = time_freq() / fps; } - void SetBreak(double Speed) { m_Break += 4.0/Speed; } // I think this 4 is related to `Len/2/2` in `Mix` function of /expand/teeworlds/demo/video_3/src/engine/client/sound.cpp - double GetBreak() { return m_Break; } - protected: static IVideo* ms_pCurrentVideo; static int64 ms_Time;