The primary device no longer starts unnecessary threads if it doesn't have a decoder

This commit is contained in:
Klaus Schmidinger 2024-03-04 12:26:32 +01:00
parent 824c495d33
commit bfa25d6276
3 changed files with 25 additions and 18 deletions

View File

@ -2565,6 +2565,8 @@ Markus Ehrnsperger <markus.ehrnsperger@googlemail.com>
for adding the move constructor to cString for better performance for adding the move constructor to cString for better performance
for fixing handling primary device on headless systems for fixing handling primary device on headless systems
for adding a 15 second grace period before actually stopping a VPS timer for adding a 15 second grace period before actually stopping a VPS timer
for making the primary device no longer start unnecessary threads if it doesn't have
a decoder
Werner Färber <w.faerber@gmx.de> Werner Färber <w.faerber@gmx.de>
for reporting a bug in handling the cPluginManager::Active() result when pressing for reporting a bug in handling the cPluginManager::Active() result when pressing

View File

@ -9887,7 +9887,7 @@ Video Disk Recorder Revision History
- Fixed possible duplicate component entries in the info of an ongoing recording - Fixed possible duplicate component entries in the info of an ongoing recording
(reported by Christoph Haubrich). (reported by Christoph Haubrich).
2024-03-03: 2024-03-04:
- Fixed the move assignment operator to check for self-assignment (suggested by - Fixed the move assignment operator to check for self-assignment (suggested by
Stefan Herdler). Stefan Herdler).
@ -9898,3 +9898,5 @@ Video Disk Recorder Revision History
in cChannel. in cChannel.
- Added a 15 second grace period before actually stopping a VPS timer (thanks to - Added a 15 second grace period before actually stopping a VPS timer (thanks to
Markus Ehrnsperger). Markus Ehrnsperger).
- The primary device no longer starts unnecessary threads if it doesn't have a decoder
(thanks to Markus Ehrnsperger).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: device.c 5.10 2024/01/22 12:10:30 kls Exp $ * $Id: device.c 5.11 2024/03/04 12:26:32 kls Exp $
*/ */
#include "device.h" #include "device.h"
@ -923,23 +923,26 @@ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView)
} }
if (Result == scrOk) { if (Result == scrOk) {
if (LiveView && IsPrimaryDevice(false)) { if (LiveView) {
if (patFilter) // this is only for FF DVB cards! if (IsPrimaryDevice(false))
patFilter->Request(Channel->Sid()); currentChannel = Channel->Number();
currentChannel = Channel->Number(); if (IsPrimaryDevice()) {
// Set the available audio tracks: if (patFilter) // this is only for FF DVB cards!
ClrAvailableTracks(); patFilter->Request(Channel->Sid());
for (int i = 0; i < MAXAPIDS; i++) // Set the available audio tracks:
SetAvailableTrack(ttAudio, i, Channel->Apid(i), Channel->Alang(i)); ClrAvailableTracks();
if (Setup.UseDolbyDigital) { for (int i = 0; i < MAXAPIDS; i++)
for (int i = 0; i < MAXDPIDS; i++) SetAvailableTrack(ttAudio, i, Channel->Apid(i), Channel->Alang(i));
SetAvailableTrack(ttDolby, i, Channel->Dpid(i), Channel->Dlang(i)); if (Setup.UseDolbyDigital) {
for (int i = 0; i < MAXDPIDS; i++)
SetAvailableTrack(ttDolby, i, Channel->Dpid(i), Channel->Dlang(i));
}
for (int i = 0; i < MAXSPIDS; i++)
SetAvailableTrack(ttSubtitle, i, Channel->Spid(i), Channel->Slang(i));
if (!NeedsTransferMode)
EnsureAudioTrack(true);
EnsureSubtitleTrack();
} }
for (int i = 0; i < MAXSPIDS; i++)
SetAvailableTrack(ttSubtitle, i, Channel->Spid(i), Channel->Slang(i));
if (!NeedsTransferMode)
EnsureAudioTrack(true);
EnsureSubtitleTrack();
} }
cStatus::MsgChannelSwitch(this, Channel->Number(), LiveView); // only report status if channel switch successful cStatus::MsgChannelSwitch(this, Channel->Number(), LiveView); // only report status if channel switch successful
} }