diff options
| author | Andreas Mair <andreas@vdr-developer.org> | 2011-04-18 16:01:47 +0200 |
|---|---|---|
| committer | Andreas Mair <andreas@vdr-developer.org> | 2011-04-18 16:01:47 +0200 |
| commit | 02265ea0295a3952b0f728cc29883c4421ad08d6 (patch) | |
| tree | f53c431964aefb0a5d6e0ed391cf685bd0d8a22a | |
| parent | 1db0647d868664cb4d296883a14519cdc6823aaf (diff) | |
| download | vdr-plugin-extrecmenu-02265ea0295a3952b0f728cc29883c4421ad08d6.tar.gz vdr-plugin-extrecmenu-02265ea0295a3952b0f728cc29883c4421ad08d6.tar.bz2 | |
Fix prio/lifetime editing for TS recordings for VDR 1.7.18+.
| -rw-r--r-- | mymenueditrecording.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/mymenueditrecording.c b/mymenueditrecording.c index 135fd5e..6ce8db1 100644 --- a/mymenueditrecording.c +++ b/mymenueditrecording.c @@ -559,15 +559,26 @@ eOSState myMenuRecordingDetails::ProcessKey(eKeys Key) #define INFOFILE_PES "info.vdr" #define INFOFILE_TS "info" bool myMenuRecordingDetails::ModifyInfo(cRecording *Recording, const char *Info) -{ //This has been taken from remotetimers-0.1.3, written by Frank Schmirler <vdrdev@schmirler.de> +{ //This has been taken from remotetimers-0.1.5, written by Frank Schmirler <vdrdev@schmirler.de> - // check for write access as cRecording::WriteInfo() always returns true - // TODO: writing may still fail as access() doesn't use the effective UID #if VDRVERSNUM > 10713 cString InfoFileName=cString::sprintf(Recording->IsPesRecording()?"%s/"INFOFILE_PES:"%s/"INFOFILE_TS,Recording->FileName()); + FILE *f = fopen(InfoFileName, "a"); + if (f) + { + fprintf(f, "%s\n", Info); + fclose(f); + // Casting const away is nasty, but what the heck? + // The Recordings thread is locked and the object is going to be deleted anyway. + if (((cRecordingInfo *)Recording->Info())->Read() && Recording->WriteInfo()) + return true; + esyslog("[extrecmenu] Failed to update '%s'", *InfoFileName); + } + else + esyslog("[extrecmenu] writing to '%s' failed: %m", *InfoFileName); #else cString InfoFileName=cString::sprintf("%s/"INFOFILE_PES,Recording->FileName()); -#endif + // check for write access as cRecording::WriteInfo() always returns true if(access(InfoFileName,W_OK)==0) { FILE *f=fmemopen((void *)Info,strlen(Info)*sizeof(char),"r"); @@ -584,5 +595,6 @@ bool myMenuRecordingDetails::ModifyInfo(cRecording *Recording, const char *Info) } else esyslog("[extrecmenu] '%s' not writeable: %m",*InfoFileName); +#endif return false; } |
