vdr: add upstream patches

This commit is contained in:
mglae 2018-11-09 19:13:36 +01:00
parent 1a60beb4bd
commit b1920c9134
7 changed files with 234 additions and 2 deletions

View File

@ -4,8 +4,8 @@ ftp://ftp.tvdr.de/vdr/Developer/Patches/vdr-2.4/
# and UPDT. The tfRecording flag must only be handled by the VDR that actually hosts # and UPDT. The tfRecording flag must only be handled by the VDR that actually hosts
# and processes the timer. # and processes the timer.
# #
--- svdrp.c 2018/03/19 12:16:33 5.0 --- a/svdrp.c 2018/03/19 12:16:33 5.0
+++ svdrp.c 2018/04/19 09:45:08 +++ b/svdrp.c 2018/04/19 09:45:08
@@ -2036,6 +2036,7 @@ @@ -2036,6 +2036,7 @@
LOCK_TIMERS_WRITE; LOCK_TIMERS_WRITE;
Timers->SetExplicitModify(); Timers->SetExplicitModify();

View File

@ -0,0 +1,48 @@
# This patch fixes a possible invalid locking sequence in case a remote timer handling error message
# is displayed on the OSD and the skin tries to lock the Recordings or DeletedRecordings
# list in its Flush() function (for instance by calling cVideoDiskUsage::HasChanged()).
# To do this, the call to Skins.Message() in menu.c's HandleRemoteModifications() has
# been changed to Skins.QueueMessage(), and cSkins::ProcessQueuedMessages() is now called
# unconditionally in the main loop, and checks whether the current cSkinDisplay object
# (if any) implements SetMessage().
#
--- 1/menu.c 2018/04/14 10:24:41 5.0
+++ 1/menu.c 2018/04/28 12:09:45
@@ -1075,7 +1075,7 @@
{
cString ErrorMessage;
if (!HandleRemoteTimerModifications(NewTimer, OldTimer, &ErrorMessage)) {
- Skins.Message(mtError, ErrorMessage);
+ Skins.QueueMessage(mtError, ErrorMessage);
return false;
}
return true;
--- 1/skins.c 2013/08/18 12:07:22 5.0
+++ 1/skins.c 2018/04/28 12:13:01
@@ -352,6 +352,14 @@
dsyslog("cSkins::ProcessQueuedMessages() called from background thread - ignored!");
return;
}
+ // Check whether there is a cSkinDisplay object (if any) that implements SetMessage():
+ if (cSkinDisplay *sd = cSkinDisplay::Current()) {
+ if (!(dynamic_cast<cSkinDisplayChannel *>(sd) ||
+ dynamic_cast<cSkinDisplayMenu *>(sd) ||
+ dynamic_cast<cSkinDisplayReplay *>(sd) ||
+ dynamic_cast<cSkinDisplayMessage *>(sd)))
+ return;
+ }
cSkinQueuedMessage *msg = NULL;
// Get the first waiting message:
queueMessageMutex.Lock();
--- 1/vdr.c 2018/04/10 13:24:43 5.0
+++ 1/vdr.c 2018/04/28 11:27:48
@@ -1176,8 +1176,7 @@
if (!Menu && !cOsd::IsOpen())
Menu = CamControl();
// Queued messages:
- if (!Skins.IsOpen())
- Skins.ProcessQueuedMessages();
+ Skins.ProcessQueuedMessages();
// User Input:
cOsdObject *Interact = Menu ? Menu : cControl::Control();
eKeys key = Interface->GetKey(!Interact || !Interact->NeedsFastResponse());

View File

@ -0,0 +1,89 @@
# Fixed locking the Channels list in cDisplayChannel, where the lock was still held
# when Flush() was called.
#
--- 1/menu.c 2018/04/28 12:09:45 5.1
+++ 1/menu.c 2018/05/06 09:30:11
@@ -4626,14 +4626,17 @@
cOsdProvider::OsdSizeChanged(osdState); // just to get the current state
positioner = NULL;
channel = NULL;
- LOCK_CHANNELS_READ;
- channel = Channels->GetByNumber(Number);
- lastPresent = lastFollowing = NULL;
- if (channel) {
- DisplayChannel();
- DisplayInfo();
+ {
+ LOCK_CHANNELS_READ;
+ channel = Channels->GetByNumber(Number);
+ lastPresent = lastFollowing = NULL;
+ if (channel) {
+ DisplayChannel();
+ DisplayInfo();
+ }
+ }
+ if (channel)
displayChannel->Flush();
- }
lastTime.Set();
}
@@ -4868,31 +4871,33 @@
}
};
if (positioner || !timeout || lastTime.Elapsed() < (uint64_t)(Setup.ChannelInfoTime * 1000)) {
- LOCK_CHANNELS_READ;
- if (Key == kNone && !number && group < 0 && !NewChannel && channel && channel->Number() != cDevice::CurrentChannel()) {
- // makes sure a channel switch through the SVDRP CHAN command is displayed
- channel = Channels->GetByNumber(cDevice::CurrentChannel());
- Refresh();
- lastTime.Set();
- }
- DisplayInfo();
- if (NewChannel) {
- SetTrackDescriptions(NewChannel->Number()); // to make them immediately visible in the channel display
- Channels->SwitchTo(NewChannel->Number());
- SetTrackDescriptions(NewChannel->Number()); // switching the channel has cleared them
- channel = NewChannel;
- }
- const cPositioner *Positioner = cDevice::ActualDevice()->Positioner();
- bool PositionerMoving = Positioner && Positioner->IsMoving();
- SetNeedsFastResponse(PositionerMoving);
- if (!PositionerMoving) {
- if (positioner)
- lastTime.Set(); // to keep the channel display up a few seconds after the target position has been reached
- Positioner = NULL;
- }
- if (Positioner || positioner) // making sure we call SetPositioner(NULL) if there is a switch from "with" to "without" positioner
- displayChannel->SetPositioner(Positioner);
- positioner = Positioner;
+ {
+ LOCK_CHANNELS_READ;
+ if (Key == kNone && !number && group < 0 && !NewChannel && channel && channel->Number() != cDevice::CurrentChannel()) {
+ // makes sure a channel switch through the SVDRP CHAN command is displayed
+ channel = Channels->GetByNumber(cDevice::CurrentChannel());
+ Refresh();
+ lastTime.Set();
+ }
+ DisplayInfo();
+ if (NewChannel) {
+ SetTrackDescriptions(NewChannel->Number()); // to make them immediately visible in the channel display
+ Channels->SwitchTo(NewChannel->Number());
+ SetTrackDescriptions(NewChannel->Number()); // switching the channel has cleared them
+ channel = NewChannel;
+ }
+ const cPositioner *Positioner = cDevice::ActualDevice()->Positioner();
+ bool PositionerMoving = Positioner && Positioner->IsMoving();
+ SetNeedsFastResponse(PositionerMoving);
+ if (!PositionerMoving) {
+ if (positioner)
+ lastTime.Set(); // to keep the channel display up a few seconds after the target position has been reached
+ Positioner = NULL;
+ }
+ if (Positioner || positioner) // making sure we call SetPositioner(NULL) if there is a switch from "with" to "without" positioner
+ displayChannel->SetPositioner(Positioner);
+ positioner = Positioner;
+ }
displayChannel->Flush();
return osContinue;
}

View File

@ -0,0 +1,18 @@
# Fixed locking the Channels list in cDisplayChannel, where the lock was still held
# when Flush() was called (cont'd).
#
--- 1/menu.c 2018/05/06 09:30:11 5.2
+++ 1/menu.c 2018/05/27 09:51:56 5.3
@@ -4654,8 +4654,10 @@
displayChannel = Skins.Current()->DisplayChannel(withInfo);
positioner = NULL;
channel = NULL;
- LOCK_CHANNELS_READ;
- channel = Channels->GetByNumber(cDevice::CurrentChannel());
+ {
+ LOCK_CHANNELS_READ;
+ channel = Channels->GetByNumber(cDevice::CurrentChannel());
+ }
ProcessKey(FirstKey);
}

View File

@ -0,0 +1,33 @@
# Fixed shutdown after user inactivity in case a plugin is keeping the OSD open.
#
--- a/vdr.c 2018/04/28 11:27:48 5.1
+++ b/vdr.c 2018/07/16 08:52:40 5.2
@@ -1514,9 +1514,7 @@
ShutdownHandler.countdown.Cancel();
}
- if ((Now - LastInteract) > ACTIVITYTIMEOUT && !cRecordControls::Active() && !RecordingsHandler.Active() && (Now - cRemote::LastActivity()) > ACTIVITYTIMEOUT) {
- // Handle housekeeping tasks
-
+ if (!cRecordControls::Active() && !RecordingsHandler.Active() && (Now - cRemote::LastActivity()) > ACTIVITYTIMEOUT) {
// Shutdown:
// Check whether VDR will be ready for shutdown in SHUTDOWNWAIT seconds:
time_t Soon = Now + SHUTDOWNWAIT;
@@ -1535,7 +1533,8 @@
// Do this again a bit later:
ShutdownHandler.SetRetry(SHUTDOWNRETRY);
}
-
+ // Handle housekeeping tasks
+ if ((Now - LastInteract) > ACTIVITYTIMEOUT) {
// Disk housekeeping:
RemoveDeletedRecordings();
ListGarbageCollector.Purge();
@@ -1543,6 +1542,7 @@
// Plugins housekeeping:
PluginManager.Housekeeping();
}
+ }
ReportEpgBugFixStats();

View File

@ -0,0 +1,31 @@
# Fixed switching through encrypted channels with the Up/Down keys
#
--- a/device.c 2018/03/24 09:49:14 5.0
+++ b/device.c 2018/07/16 09:29:57
@@ -787,6 +787,7 @@
if (LiveView) {
isyslog("switching to channel %d %s (%s)", Channel->Number(), *Channel->GetChannelID().ToString(), Channel->Name());
cControl::Shutdown(); // prevents old channel from being shown too long if GetDevice() takes longer
+ // and, if decrypted, this removes the now superflous PIDs from the CAM, too
}
for (int i = 3; i--;) {
switch (SetChannel(Channel, LiveView)) {
@@ -809,6 +810,7 @@
Direction = sgn(Direction);
if (Direction) {
cControl::Shutdown(); // prevents old channel from being shown too long if GetDevice() takes longer
+ // and, if decrypted, this removes the now superflous PIDs from the CAM, too
int n = CurrentChannel() + Direction;
int first = n;
LOCK_CHANNELS_READ;
--- a/menu.c 2018/05/27 09:51:56 5.3
+++ b/menu.c 2018/07/16 09:29:57
@@ -4704,6 +4704,8 @@
const cChannel *cDisplayChannel::NextAvailableChannel(const cChannel *Channel, int Direction)
{
if (Direction) {
+ cControl::Shutdown(); // prevents old channel from being shown too long if GetDevice() takes longer
+ // and, if decrypted, this removes the now superflous PIDs from the CAM, too
LOCK_CHANNELS_READ;
while (Channel) {
Channel = Direction > 0 ? Channels->Next(Channel) : Channels->Prev(Channel);

View File

@ -0,0 +1,13 @@
# Now deactivating MTD support if a non MCD capable CAM is inserted after removing
# a previously used CAM that is MCD capable.
#
--- a/ci.c 2018/03/19 16:37:03 5.0
+++ b/ci.c 2018/09/23 10:17:20
@@ -1213,6 +1213,7 @@
}
else {
dsyslog("CAM %d: doesn't reply to QUERY - only a single channel can be decrypted", CamSlot()->SlotNumber());
+ CamSlot()->MtdActivate(false);
state = 4; // normal operation
}
}