From 419938bd6b18ec3005cfe2ec223e87a96607f23e Mon Sep 17 00:00:00 2001 From: Martin Dummer Date: Tue, 19 Jun 2012 10:17:01 +0200 Subject: =?UTF-8?q?merge=20patch=20with=20changes=20for=20VDR=20>=3D=201.7?= =?UTF-8?q?.3=20from=20Thomas=20G=C3=BCnther=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HISTORY | 1 + menuundelete.c | 13 +++++++++++++ undelete.c | 13 +++++++++++++ 3 files changed, 27 insertions(+) diff --git a/HISTORY b/HISTORY index 1408099..8f3de74 100644 --- a/HISTORY +++ b/HISTORY @@ -45,5 +45,6 @@ VDR Plugin 'undelete' Revision History - edit the README file - merge patch for gcc-4.4 from Holger Schvestka - merge patch with changes for VDR >= 1.5.7 from Stone +- merge patch with changes for VDR >= 1.7.3 from Thomas Günther diff --git a/menuundelete.c b/menuundelete.c index 6f9b2d9..0402c71 100644 --- a/menuundelete.c +++ b/menuundelete.c @@ -672,11 +672,20 @@ eOSState cMenuUndelete::ProcessKey(eKeys Key) processerror = true; } SalvageRecording = true; +#if VDRVERSNUM >= 10703 + cIndexFile *index = new cIndexFile(NewName, false, recording->IsPesRecording()); +#else cIndexFile *index = new cIndexFile(NewName, false); +#endif int LastFrame = index->Last() - 1; if (LastFrame > 0) { +#if VDRVERSNUM >= 10703 + uint16_t FileNumber = 0; + off_t FileOffset = 0; +#else uchar FileNumber = 0; int FileOffset = 0; +#endif index->Get(LastFrame, &FileNumber, &FileOffset); delete index; if (FileNumber == 0) { @@ -686,7 +695,11 @@ eOSState cMenuUndelete::ProcessKey(eKeys Key) } else { for (int i = 1; i <= FileNumber; i++) { char *temp; +#if VDRVERSNUM >= 10703 + asprintf(&temp, recording->IsPesRecording() ? "%s/%03d.vdr" : "%s/%05d.ts", (const char *)NewName, i); +#else asprintf(&temp, "%s/%03d.vdr", (const char *)NewName, i); +#endif if (access(temp, R_OK) != 0) { i = FileNumber; if (verbose.u) diff --git a/undelete.c b/undelete.c index f76d08d..226737b 100644 --- a/undelete.c +++ b/undelete.c @@ -960,17 +960,30 @@ cString cPluginUndelete::SVDRPCommand(const char *Command, const char *Option, i asprintf(&temp, "%sS#%d#", SVDRP_Process ? SVDRP_Process : "", recnumber); free(SVDRP_Process); SVDRP_Process = temp; +#if VDRVERSNUM >= 10703 + cIndexFile *index = new cIndexFile(NewName, false, recording->IsPesRecording()); +#else cIndexFile *index = new cIndexFile(NewName, false); +#endif int LastFrame = index->Last() - 1; if (LastFrame > 0) { +#if VDRVERSNUM >= 10703 + uint16_t FileNumber = 0; + off_t FileOffset = 0; +#else uchar FileNumber = 0; int FileOffset = 0; +#endif index->Get(LastFrame, &FileNumber, &FileOffset); delete index; if (FileNumber == 0) return cString::sprintf("error while read last filenumber for \"%s\" [%s]", Option, recording->Title()); for (int i = 1; i <= FileNumber; i++) { +#if VDRVERSNUM >= 10703 + asprintf(&temp, recording->IsPesRecording() ? "%s/%03d.vdr" : "%s/%05d.ts", (const char *)NewName, i); +#else asprintf(&temp, "%s/%03d.vdr", (const char *)NewName, i); +#endif if (access(temp, R_OK) != 0) { free(temp); return cString::sprintf("error accessing vdrfile %03d for \"%s\" [%s]", i, Option, recording->Title()); -- cgit v1.2.3