On Dienstag, 16. Juni 2009, Joachim Welker wrote:
> Hi Klaus,
> I see you are very busy in developing the new vdr-1.7.* (thanks for your
> great work !). But what about stable vdr-1.6.0? You released two patches
> which should result in version vdr-1.6.1. AFAIR there were no complaints
> about these patches, so I think it's save to release vdr-1.6.1 in order to
> rule off the last stable version.
>
Well, if the goal is to release a vdr-1.6.1 version,
I suggest to first collect further patches needed to compile it on recent
systems:
* compiling with gcc-4.4 and glibc-2.10: fixing some variable const issues and
some other warnings
* compiling against linux-headers with s2api (api version 5)
The gentoo versions of these patches are attached.
The gcc-4.4 patch is based on Ludwig Nussels version plus improvments of
Klaus. The last const_cast is replaced by using the fileName member of
cRecording as cRecordings is a friend class.
I don't know if more fixes are floating around that need to be applied.
Regards
Matthias
diff --git a/recording.c b/recording.c
--- a/recording.c
+++ b/recording.c
@@ -509,8 +509,8 @@ cRecording::cRecording(cTimer *Timer, const cEvent *Event)
Utf8Strn0Cpy(SubtitleBuffer, Subtitle, MAX_SUBTITLE_LENGTH);
Subtitle = SubtitleBuffer;
}
- char *macroTITLE = strstr(Timer->File(), TIMERMACRO_TITLE);
- char *macroEPISODE = strstr(Timer->File(), TIMERMACRO_EPISODE);
+ const char *macroTITLE = strstr(Timer->File(), TIMERMACRO_TITLE);
+ const char *macroEPISODE = strstr(Timer->File(), TIMERMACRO_EPISODE);
if (macroTITLE || macroEPISODE) {
name = strdup(Timer->File());
name = strreplace(name, TIMERMACRO_TITLE, Title);
@@ -551,7 +551,7 @@ cRecording::cRecording(const char *FileName)
sortBuffer = NULL;
fileName = strdup(FileName);
FileName += strlen(VideoDirectory) + 1;
- char *p = strrchr(FileName, '/');
+ const char *p = strrchr(FileName, '/');
name = NULL;
info = new cRecordingInfo;
@@ -1022,7 +1022,7 @@ void cRecordings::DelByName(const char *FileName)
if (recording) {
cThreadLock DeletedRecordingsLock(&DeletedRecordings);
Del(recording, false);
- char *ext = strrchr(recording->FileName(), '.');
+ char *ext = strrchr(recording->fileName, '.');
if (ext) {
strncpy(ext, DELEXT, strlen(ext));
recording->fileSizeMB = DirSizeMB(recording->FileName());
diff --git a/svdrp.c b/svdrp.c
--- a/svdrp.c
+++ b/svdrp.c
@@ -736,7 +736,7 @@ void cSVDRP::CmdGRAB(const char *Option)
char *strtok_next;
FileName = strtok_r(p, delim, &strtok_next);
// image type:
- char *Extension = strrchr(FileName, '.');
+ const char *Extension = strrchr(FileName, '.');
if (Extension) {
if (strcasecmp(Extension, ".jpg") == 0 || strcasecmp(Extension, ".jpeg") == 0)
Jpeg = true;
@@ -795,16 +795,17 @@ void cSVDRP::CmdGRAB(const char *Option)
char RealFileName[PATH_MAX];
if (FileName) {
if (grabImageDir) {
- cString s;
- char *slash = strrchr(FileName, '/');
+ cString s(FileName);
+ FileName = s;
+ const char *slash = strrchr(FileName, '/');
if (!slash) {
s = AddDirectory(grabImageDir, FileName);
FileName = s;
}
slash = strrchr(FileName, '/'); // there definitely is one
- *slash = 0;
- char *r = realpath(FileName, RealFileName);
- *slash = '/';
+ cString t(s);
+ t.Truncate(slash - FileName);
+ char *r = realpath(t, RealFileName);
if (!r) {
LOG_ERROR_STR(FileName);
Reply(501, "Invalid file name \"%s\"", FileName);
diff --git a/channels.c b/channels.c
--- a/channels.c
+++ b/channels.c
@@ -574,7 +574,7 @@ void cChannel::SetLinkChannels(cLinkChannels *LinkChannels)
}
else
q += sprintf(q, " none");
- dsyslog(buffer);
+ dsyslog("%s", buffer);
}
void cChannel::SetRefChannel(cChannel *RefChannel)
diff --git a/device.c b/device.c
--- a/device.c
+++ b/device.c
@@ -529,7 +529,7 @@ eVideoSystem cDevice::GetVideoSystem(void)
return vsPAL;
}
-//#define PRINTPIDS(s) { char b[500]; char *q = b; q += sprintf(q, "%d %s ", CardIndex(), s); for (int i = 0; i < MAXPIDHANDLES; i++) q += sprintf(q, " %s%4d %d", i == ptOther ? "* " : "", pidHandles[i].pid, pidHandles[i].used); dsyslog(b); }
+//#define PRINTPIDS(s) { char b[500]; char *q = b; q += sprintf(q, "%d %s ", CardIndex(), s); for (int i = 0; i < MAXPIDHANDLES; i++) q += sprintf(q, " %s%4d %d", i == ptOther ? "* " : "", pidHandles[i].pid, pidHandles[i].used); dsyslog("%s", b); }
#define PRINTPIDS(s)
bool cDevice::HasPid(int Pid) const
diff --git a/pat.c b/pat.c
--- a/pat.c
+++ b/pat.c
@@ -144,7 +144,7 @@ void cCaDescriptors::AddCaDescriptor(SI::CaDescriptor *d, bool Stream)
q += sprintf(q, "CAM: %04X %5d %5d %04X %d -", source, transponder, serviceId, d->getCaType(), Stream);
for (int i = 0; i < nca->Length(); i++)
q += sprintf(q, " %02X", nca->Data()[i]);
- dsyslog(buffer);
+ dsyslog("%s", buffer);
#endif
}
diff --git a/receiver.c b/receiver.c
--- a/receiver.c
+++ b/receiver.c
@@ -40,7 +40,7 @@ cReceiver::~cReceiver()
{
if (device) {
const char *msg = "ERROR: cReceiver has not been detached yet! This is a design fault and VDR will segfault now!";
- esyslog(msg);
+ esyslog("%s", msg);
fprintf(stderr, "%s\n", msg);
*(char *)0 = 0; // cause a segfault
}
diff -ru vdr-1.6.0-orig/dvbdevice.h vdr-1.6.0/dvbdevice.h
--- vdr-1.6.0-orig/dvbdevice.h 2009-01-12 14:05:10.000000000 +0100
+++ vdr-1.6.0/dvbdevice.h 2009-01-12 14:05:52.000000000 +0100
@@ -15,7 +15,7 @@
#include "device.h"
#include "dvbspu.h"
-#if DVB_API_VERSION != 3
+#if (DVB_API_VERSION != 3) && (DVB_API_VERSION != 5)
#error VDR requires Linux DVB driver API version 3!
#endif
_______________________________________________
vdr mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr