From df1fa6a6bfdd2b217798a1f3fe0666443a32e478 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 15 May 2013 16:00:09 +0400 Subject: [PATCH] driver/record.cpp: show record duration in xx hour yy min format --- src/driver/record.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 436a5ccdc..6f86c9e7e 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -677,8 +677,10 @@ void CRecordInstance::GetRecordString(std::string &str) int err = GetStatus(); strftime(stime, sizeof(stime), "%H:%M:%S ", localtime(&start_time)); time_t duration = time(0) - start_time; - char dtime[15]; - snprintf(dtime, sizeof(dtime), " (%02d:%02d)", (int) duration/3600, (int) duration/60); + char dtime[20]; + int h = duration/3600; + int m = duration/60; + snprintf(dtime, sizeof(dtime), " (%02d %s %02d min)", h, h == 1 ? "hour" : "hours", m); str = stime + channel->getName() + ": " + GetEpgTitle() + ((err & REC_STATUS_OVERFLOW) ? " [!]" : "") + dtime; }