From 6ed8db5ecd756e5dfcc11dad6a5007fdd66ab66e Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 27 Jun 2025 08:46:07 +0200 Subject: [PATCH] When regenerating the index of a recording, PID changes are now taken into account --- CONTRIBUTORS | 2 ++ HISTORY | 4 +++- recording.c | 16 ++++++++++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index e9fba752..2e9ac3dc 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2475,6 +2475,8 @@ Christoph Haubrich for adding a workaround in detecting frame height for channels with wrong crop parameters for reporting duplicate component entries in the info of an ongoing recording for reporting a problem where the info file of an ongoing recording was not re-read + for reporting that some channels change their video PID in the middle of a broadcast, + which needs to be taken into account when regenerating the index of a recording Pekka Mauno for fixing cSchedule::GetFollowingEvent() in case there is currently no present diff --git a/HISTORY b/HISTORY index 5ebb3cf7..ca132870 100644 --- a/HISTORY +++ b/HISTORY @@ -10138,6 +10138,8 @@ Video Disk Recorder Revision History - Fixed an invalid lock sequence when pressing the Channel+/Channel- keys while in the "What's on..." menu in live view. -2025-06-23: +2025-06-27: - Fixed cPoller::Poll() to allow negative timeout values again. +- When regenerating the index of a recording, PID changes are now taken into account + (reported by Christoph Haubrich). diff --git a/recording.c b/recording.c index 658eb4ae..9df00429 100644 --- a/recording.c +++ b/recording.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.c 5.42 2025/06/19 13:35:32 kls Exp $ + * $Id: recording.c 5.43 2025/06/27 08:46:07 kls Exp $ */ #include "recording.h" @@ -2604,8 +2604,20 @@ void cIndexFileGenerator::Action(void) if (Data) { if (FrameDetector.Synced()) { // Step 3 - generate the index: - if (TsPid(Data) == PATPID) + if (TsPid(Data) == PATPID) { + int OldPatVersion, OldPmtVersion; + PatPmtParser.GetVersions(OldPatVersion, OldPmtVersion); + if (PatPmtParser.ParsePatPmt(Data, Length)) { + int NewPatVersion, NewPmtVersion; + if (PatPmtParser.GetVersions(NewPatVersion, NewPmtVersion)) { + if (NewPatVersion != OldPatVersion || NewPmtVersion != OldPmtVersion) { + dsyslog("PAT/PMT version change while generating index"); + FrameDetector.SetPid(PatPmtParser.Vpid() ? PatPmtParser.Vpid() : PatPmtParser.Apid(0), PatPmtParser.Vpid() ? PatPmtParser.Vtype() : PatPmtParser.Atype(0)); + } + } + } FrameOffset = FileSize; // the PAT/PMT is at the beginning of an I-frame + } int Processed = FrameDetector.Analyze(Data, Length); if (Processed > 0) { int PreviousErrors = 0;