1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed handling the tfRecording flag in the SVDRP commands MODT and UPDT

This commit is contained in:
Klaus Schmidinger 2018-04-19 09:45:08 +02:00
parent c48d5242ce
commit d84ec07ff6
3 changed files with 18 additions and 1 deletions

View File

@ -2854,6 +2854,7 @@ Johann Friedrichs <johann.friedrichs@web.de>
replay has been stopped, but before the replay control has been destroyed replay has been stopped, but before the replay control has been destroyed
for reporting a problem in processing SVDRP client responses in case the caller doesn't for reporting a problem in processing SVDRP client responses in case the caller doesn't
want the actual response strings want the actual response strings
for reporting a bug in handling the tfRecording flag in the SVDRP commands MODT and UPDT
Timo Helkio <timolavi@mbnet.fi> Timo Helkio <timolavi@mbnet.fi>
for reporting a hangup when replaying a TS recording with subtitles activated for reporting a hangup when replaying a TS recording with subtitles activated

View File

@ -9347,3 +9347,8 @@ Video Disk Recorder Revision History
- Fixed a high CPU load during replay with active progress display (reported by Matthias - Fixed a high CPU load during replay with active progress display (reported by Matthias
Senzel). Senzel).
- Official release. - Official release.
2018-04-19: Version 2.4.1
- Fixed handling the tfRecording flag in the SVDRP commands MODT and UPDT (reported
by Johann Friedrichs).

13
svdrp.c
View File

@ -10,7 +10,7 @@
* and interact with the Video Disk Recorder - or write a full featured * and interact with the Video Disk Recorder - or write a full featured
* graphical interface that sits on top of an SVDRP connection. * graphical interface that sits on top of an SVDRP connection.
* *
* $Id: svdrp.c 4.37 2018/03/19 12:16:33 kls Exp $ * $Id: svdrp.c 4.38 2018/04/19 09:45:08 kls Exp $
*/ */
#include "svdrp.h" #include "svdrp.h"
@ -2036,6 +2036,7 @@ void cSVDRPServer::CmdMODT(const char *Option)
LOCK_TIMERS_WRITE; LOCK_TIMERS_WRITE;
Timers->SetExplicitModify(); Timers->SetExplicitModify();
if (cTimer *Timer = Timers->GetById(Id)) { if (cTimer *Timer = Timers->GetById(Id)) {
bool IsRecording = Timer->HasFlags(tfRecording);
cTimer t = *Timer; cTimer t = *Timer;
if (strcasecmp(tail, "ON") == 0) if (strcasecmp(tail, "ON") == 0)
t.SetFlags(tfActive); t.SetFlags(tfActive);
@ -2046,6 +2047,10 @@ void cSVDRPServer::CmdMODT(const char *Option)
return; return;
} }
*Timer = t; *Timer = t;
if (IsRecording)
Timer->SetFlags(tfRecording);
else
Timer->ClrFlags(tfRecording);
Timers->SetModified(); Timers->SetModified();
isyslog("SVDRP %s < %s modified timer %s (%s)", Setup.SVDRPHostName, *clientName, *Timer->ToDescr(), Timer->HasFlags(tfActive) ? "active" : "inactive"); isyslog("SVDRP %s < %s modified timer %s (%s)", Setup.SVDRPHostName, *clientName, *Timer->ToDescr(), Timer->HasFlags(tfActive) ? "active" : "inactive");
Reply(250, "%d %s", Timer->Id(), *Timer->ToText(true)); Reply(250, "%d %s", Timer->Id(), *Timer->ToText(true));
@ -2478,12 +2483,18 @@ void cSVDRPServer::CmdUPDT(const char *Option)
if (Timer->Parse(Option)) { if (Timer->Parse(Option)) {
LOCK_TIMERS_WRITE; LOCK_TIMERS_WRITE;
if (cTimer *t = Timers->GetTimer(Timer)) { if (cTimer *t = Timers->GetTimer(Timer)) {
bool IsRecording = t->HasFlags(tfRecording);
t->Parse(Option); t->Parse(Option);
delete Timer; delete Timer;
Timer = t; Timer = t;
if (IsRecording)
Timer->SetFlags(tfRecording);
else
Timer->ClrFlags(tfRecording);
isyslog("SVDRP %s < %s updated timer %s", Setup.SVDRPHostName, *clientName, *Timer->ToDescr()); isyslog("SVDRP %s < %s updated timer %s", Setup.SVDRPHostName, *clientName, *Timer->ToDescr());
} }
else { else {
Timer->ClrFlags(tfRecording);
Timers->Add(Timer); Timers->Add(Timer);
isyslog("SVDRP %s < %s added timer %s", Setup.SVDRPHostName, *clientName, *Timer->ToDescr()); isyslog("SVDRP %s < %s added timer %s", Setup.SVDRPHostName, *clientName, *Timer->ToDescr());
} }