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

Fixed restarting PMT pids after starting a recording on the currently viewed channel

This commit is contained in:
Klaus Schmidinger 2021-06-11 09:38:38 +02:00
parent a0cdfc432a
commit a4a2466bf4
3 changed files with 27 additions and 7 deletions

View File

@ -9719,3 +9719,8 @@ Video Disk Recorder Revision History
- Fixed flushing old data from the section handler (thanks to Helmut Binder). - Fixed flushing old data from the section handler (thanks to Helmut Binder).
- Removed unused declaration of cDvbTuner::SetFrontendType() (thanks to Helmut Binder). - Removed unused declaration of cDvbTuner::SetFrontendType() (thanks to Helmut Binder).
- Fixed handling incomplete multi-packet CAT (thanks to Helmut Binder). - Fixed handling incomplete multi-packet CAT (thanks to Helmut Binder).
2021-06-11:
- Fixed restarting PMT pids after starting a recording on the currently viewed channel
(with help from Helmut Binder).

26
pat.c
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: pat.c 5.2 2021/06/08 14:57:26 kls Exp $ * $Id: pat.c 5.3 2021/06/11 09:38:38 kls Exp $
*/ */
#include "pat.h" #include "pat.h"
@ -295,8 +295,7 @@ public:
int Pid(void) { return pid; } int Pid(void) { return pid; }
int Count(void) { return count; } int Count(void) { return count; }
int State(void) { int s = state; state = 0; return s; } // returns the current state and resets it int State(void) { int s = state; state = 0; return s; } // returns the current state and resets it
void SetState(void) { state = 1; } void SetState(int State) { state = State; } // 1 = add the PID, -1 = delete the PID, 0 = do nothing
void ClrState(void) { state = -1; }
void Inc(void) { if (++count == 1) state = 1; } void Inc(void) { if (++count == 1) state = 1; }
void Dec(void) { if (--count == 0) state = -1; } void Dec(void) { if (--count == 0) state = -1; }
int Complete(void) { return complete; } int Complete(void) { return complete; }
@ -372,6 +371,21 @@ cPatFilter::cPatFilter(void)
Set(0x00, 0x00); // PAT Set(0x00, 0x00); // PAT
} }
void cPatFilter::SetStatus(bool On)
{
cMutexLock MutexLock(&mutex);
if (On) { // restart all requested PMT Pids
for (cPmtPidEntry *pPid = pmtPidList.First(); pPid; pPid = pmtPidList.Next(pPid))
pPid->SetState(pPid->Count() > 0);
if (activePmt && activePmt->Count() == 0) {
activePmt->SetState(1);
timer.Set(PMT_SCAN_TIMEOUT);
}
}
DBGLOG("PAT filter set status %d", On);
cFilter::SetStatus(On);
}
bool cPatFilter::TransponderChanged(void) bool cPatFilter::TransponderChanged(void)
{ {
if (source != Source() || transponder != Transponder()) { if (source != Source() || transponder != Transponder()) {
@ -389,10 +403,10 @@ void cPatFilter::Trigger(int)
DBGLOG("PAT filter trigger"); DBGLOG("PAT filter trigger");
if (activePmt != pmtPidList.First()) { if (activePmt != pmtPidList.First()) {
if (activePmt && activePmt->Count() == 0) if (activePmt && activePmt->Count() == 0)
activePmt->ClrState(); activePmt->SetState(-1);
activePmt = pmtPidList.First(); activePmt = pmtPidList.First();
if (activePmt && activePmt->Count() == 0) { if (activePmt && activePmt->Count() == 0) {
activePmt->SetState(); activePmt->SetState(1);
timer.Set(PMT_SCAN_TIMEOUT); timer.Set(PMT_SCAN_TIMEOUT);
} }
} }
@ -570,7 +584,7 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length
if (sectionSyncer.Processed(pat.getSectionNumber(), pat.getLastSectionNumber())) { // all PAT sections done if (sectionSyncer.Processed(pat.getSectionNumber(), pat.getLastSectionNumber())) { // all PAT sections done
for (cPmtPidEntry *pPid = pmtPidList.First(); pPid; pPid = pmtPidList.Next(pPid)) { for (cPmtPidEntry *pPid = pmtPidList.First(); pPid; pPid = pmtPidList.Next(pPid)) {
if (pPid->Count() == 0) { if (pPid->Count() == 0) {
pPid->SetState(); pPid->SetState(1);
activePmt = pPid; activePmt = pPid;
timer.Set(PMT_SCAN_TIMEOUT); timer.Set(PMT_SCAN_TIMEOUT);
break; break;

3
pat.h
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: pat.h 5.1 2021/06/08 14:57:26 kls Exp $ * $Id: pat.h 5.2 2021/06/11 09:38:38 kls Exp $
*/ */
#ifndef __PAT_H #ifndef __PAT_H
@ -40,6 +40,7 @@ protected:
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length); virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length);
public: public:
cPatFilter(void); cPatFilter(void);
virtual void SetStatus(bool On);
void Trigger(int); // triggers reading the PMT PIDs that are currently not requested (dummy parameter for backwards compatibility, value is ignored) void Trigger(int); // triggers reading the PMT PIDs that are currently not requested (dummy parameter for backwards compatibility, value is ignored)
void Request(int Sid); // requests permanent reading of the PMT PID for this SID void Request(int Sid); // requests permanent reading of the PMT PID for this SID
void Release(int Sid); // releases permanent reading of the PMT PID for this SID void Release(int Sid); // releases permanent reading of the PMT PID for this SID