From b9846258c48a310a1599afd858efcf4d7e43f50a Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Tue, 9 Feb 2016 15:06:07 +0000 Subject: [PATCH] Return resume point in seconds instead of frames --- handler.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/handler.c b/handler.c index 9690bc8..f8750e6 100755 --- a/handler.c +++ b/handler.c @@ -209,7 +209,7 @@ bool jsonserver_recinfo(Json::Value& js, const char* postData) } log->log("JSONServer", Log::DEBUG, "%s", reqfilename); - + cRecordings Recordings; Recordings.Load(); // probably have to do this cRecording *recording = Recordings.GetByName(reqfilename); @@ -229,10 +229,6 @@ bool jsonserver_recinfo(Json::Value& js, const char* postData) js["LifeTime"] = recording->Lifetime(); js["Start"] = (Json::UInt)recording->Start(); - js["ResumePoint"] = 0; - cResumeFile ResumeFile(recording->FileName(), recording->IsPesRecording()); - if (ResumeFile.Read() >= 0) js["ResumePoint"] = ResumeFile.Read(); - js["CurrentlyRecordingStart"] = 0; js["CurrentlyRecordingStop"] = 0; cRecordControl *rc = cRecordControls::GetRecordControl(recording->FileName()); @@ -242,6 +238,8 @@ bool jsonserver_recinfo(Json::Value& js, const char* postData) js["CurrentlyRecordingStop"] = (Json::UInt)rc->Timer()->StopTime(); } + js["ResumePoint"] = 0; + const cRecordingInfo *info = recording->Info(); if (info) { @@ -274,6 +272,9 @@ bool jsonserver_recinfo(Json::Value& js, const char* postData) js["Components"] = jscomponents; } + + cResumeFile ResumeFile(recording->FileName(), recording->IsPesRecording()); + if (ResumeFile.Read() >= 0) js["ResumePoint"] = floor(ResumeFile.Read() / info->FramesPerSecond()); } js["Result"] = true; -- 2.39.5