From 71ccb6acb62fed319367fc71108d5b3fff8f3a5b Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 26 Nov 2005 13:55:38 +0100 Subject: [PATCH] Fixed SetProgress() in the 'skincurses' plugin in case Total is 0 --- CONTRIBUTORS | 2 ++ HISTORY | 2 ++ PLUGINS/src/skincurses/HISTORY | 4 ++++ PLUGINS/src/skincurses/skincurses.c | 6 +++--- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index f2927b0e..230b20d2 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -205,6 +205,8 @@ Stefan Huelswitt for fixing a memory leak in the SVDRP command LSTE for reporting a problem with the EPG scan disturbing players that have also set live PIDs + for reporting a problem in SetProgress() of the 'skincurses' plugin in case Total + is 0 Ulrich Röder for pointing out that there are channels that have a symbol rate higher than 27500 diff --git a/HISTORY b/HISTORY index 255cf521..99e71518 100644 --- a/HISTORY +++ b/HISTORY @@ -3953,3 +3953,5 @@ Video Disk Recorder Revision History the same transponder at the same time (or record and view different encrypted channels), provided the CAM in use can handle this. This is work in progress and isn't actively used, yet. +- Fixed SetProgress() in the 'skincurses' plugin in case Total is 0 (reported + by Stefan Huelswitt). diff --git a/PLUGINS/src/skincurses/HISTORY b/PLUGINS/src/skincurses/HISTORY index 3af01cca..80779eb9 100644 --- a/PLUGINS/src/skincurses/HISTORY +++ b/PLUGINS/src/skincurses/HISTORY @@ -21,3 +21,7 @@ VDR Plugin 'skincurses' Revision History 2005-10-01: - Added a note about using this skin to the README file. + +2005-11-26: Version 0.0.5 + +- Fixed SetProgress() in case Total is 0. diff --git a/PLUGINS/src/skincurses/skincurses.c b/PLUGINS/src/skincurses/skincurses.c index ad1a26b4..522d7cfc 100644 --- a/PLUGINS/src/skincurses/skincurses.c +++ b/PLUGINS/src/skincurses/skincurses.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: skincurses.c 1.6 2005/05/16 10:45:12 kls Exp $ + * $Id: skincurses.c 1.7 2005/11/26 13:52:39 kls Exp $ */ #include @@ -11,7 +11,7 @@ #include #include -static const char *VERSION = "0.0.4"; +static const char *VERSION = "0.0.5"; static const char *DESCRIPTION = "A text only skin"; static const char *MAINMENUENTRY = NULL; @@ -500,7 +500,7 @@ void cSkinCursesDisplayReplay::SetMode(bool Play, bool Forward, int Speed) void cSkinCursesDisplayReplay::SetProgress(int Current, int Total) { - int p = OsdWidth * Current / Total; + int p = Total > 0 ? OsdWidth * Current / Total : 0; osd->DrawRectangle(0, 1, p, 1, clrGreen); osd->DrawRectangle(p, 1, OsdWidth, 1, clrWhite); }