mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
correct time after stopping recording a video
This commit is contained in:
parent
d4a842aa34
commit
2f71720fb1
|
@ -804,7 +804,26 @@ int CDemoPlayer::NextFrame()
|
|||
const int64 CDemoPlayer::time()
|
||||
{
|
||||
#if defined(CONF_VIDEORECORDER)
|
||||
return IVideo::Current() ? IVideo::time() : time_get();
|
||||
static bool s_Recording = false;
|
||||
if (IVideo::Current())
|
||||
{
|
||||
if (!s_Recording)
|
||||
{
|
||||
s_Recording = true;
|
||||
m_Info.m_LastUpdate = IVideo::time();
|
||||
}
|
||||
return IVideo::time();
|
||||
}
|
||||
else
|
||||
{
|
||||
int64 Now = time_get();
|
||||
if (s_Recording)
|
||||
{
|
||||
s_Recording = false;
|
||||
m_Info.m_LastUpdate = Now;
|
||||
}
|
||||
return Now;
|
||||
}
|
||||
#else
|
||||
return time_get();
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue