mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
Version 1.3.32
- Added some missing braces in remux.c (thanks to Wayne Keer for reporting this one). - Removed unused MAINMENUENTRY from svdrpdemo.c (thanks to Udo Richter for reporting this one). - Fixed appending sequence end code in cDvbPlayer::Goto() (thanks to Reinhard Nissl). - Fixed syncing in cRepacker (thanks to Reinhard Nissl). - Now always using stream id 0xE0 for the video stream, to avoid problems with post processing tools that choke on different ids (suggested by Reinhard Nissl). - Updated the Estonian OSD texts (thanks to Arthur Konovalov). - Fixed cDvbPlayer::SkipFrames() to properly handle radio recordings (thanks to Reinhard Nissl). - Updated the Swedish OSD texts (thanks to Tomas Prybil). - Updated the Slovenian OSD texts (thanks to Matjaz Thaler). - Updated the Danish OSD texts (thanks to Mogens Elneff). - Made LIRC command parsing more robust (thanks to Ville Skyttä). - Introduced a separate 'plugins-install' target in the Makefile (thanks to Daniel Thompson). - Re-introduced the code that waits for a tuner lock in VDR/device.c, since apparently some users actually need it. It's not active by default, you'll have to define the WAIT_FOR_TUNER_LOCK macro in that file if you need it (suggested by Malcolm Caldwell). - Adjusted the Makefile to the dvb-kernel driver on kernel 2.6 and up (thanks to Lauri Tischler). - Repeat keys are now ignored when waiting for a keypress to cancel an operation (thanks to Marko Mäkelä). - The main menu function of a plugin can now be activated through a key macro of the form "@plugin" even if that plugin doesn't have a main menu entry (using part of a patch by Hardy Flor, which originally implemented calling plugins from SVDRP). - The menu timeout handling is now done centrally in the main program loop. - Added missing help for the 'help' keyword in the SVDRP command PLUG. - The main menu function of a plugin can now be called programmatically through the static function cRemote::CallPlugin(). - The SVDRP command PLUG now has a new option 'main' which can be used to initiate a call to the main menu function of a plugin (using part of a patch by Hardy Flor). - The new command line option '--vfat' can be used to make VDR encode special characters in recording file names, even if it wasn't compiled with VFAT=1 (suggested by Peter Bieringer). The compile time option VFAT still exists and creates a VDR that always behaves as if it were called with '--vfat'. - Replaced the ':' delimiter between hour and minute in recording file names with a '.' under Linux, too. Existing recordings with ':' as delimiter will still work. - Implemented the SVDRP command MOVC (thanks to Andreas Brachold). - Added support for multiple audio language codes in ISO639LanguageDescriptors to 'libsi' (thanks to Marcel Wiesweg). - Changed the audio PID language codes to hold up to two 3 letter codes, separated by '+', to store separate languages broadcast in two channel audio mode. - If the preferred audio language is broadcast on a PID that has two different languages in the two stereo channels, the audio channel is now properly set when switching to such a channel (thanks to Mogens Elneff for his help in testing this). - Fixed some typos in MANUAL (thanks to Ville Skyttä). - Fixed the default value for "Setup/EPG bugfix level" (thanks to Ville Skyttä for reporting this one). - Fixed defining timers that only differ in the day of week (thanks to Patrick Rother for reporting this one). - Fixed converting summary.vdr files that would result in a very long 'short text' (thanks to Carsten Koch). - Implemented a hash for the channels to reduce the system load in the EIT scanning thread (based on a patch by Georg Acher).
This commit is contained in:
166
recording.c
166
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 1.111 2005/08/13 14:00:48 kls Exp $
|
||||
* $Id: recording.c 1.113 2005/09/10 12:36:48 kls Exp $
|
||||
*/
|
||||
|
||||
#include "recording.h"
|
||||
@@ -36,15 +36,8 @@
|
||||
#define DATAFORMAT "%4d-%02d-%02d.%02d:%02d.%02d.%02d" RECEXT
|
||||
#define NAMEFORMAT "%s/%s/" DATAFORMAT
|
||||
*/
|
||||
// start of implementation for brain dead systems
|
||||
#define DATAFORMAT "%4d-%02d-%02d.%02d%*c%02d.%02d.%02d" RECEXT
|
||||
#ifdef VFAT
|
||||
#define nameFORMAT "%4d-%02d-%02d.%02d.%02d.%02d.%02d" RECEXT
|
||||
#else
|
||||
#define nameFORMAT "%4d-%02d-%02d.%02d:%02d.%02d.%02d" RECEXT
|
||||
#endif
|
||||
#define NAMEFORMAT "%s/%s/" nameFORMAT
|
||||
// end of implementation for brain dead systems
|
||||
#define NAMEFORMAT "%s/%s/" "%4d-%02d-%02d.%02d.%02d.%02d.%02d" RECEXT
|
||||
|
||||
#define RESUMEFILESUFFIX "/resume%s%s.vdr"
|
||||
#ifdef SUMMARYFALLBACK
|
||||
@@ -65,6 +58,8 @@
|
||||
|
||||
#define MAX_SUBTITLE_LENGTH 40
|
||||
|
||||
bool VfatFileSystem = false;
|
||||
|
||||
void RemoveDeletedRecordings(void)
|
||||
{
|
||||
static time_t LastRemoveCheck = 0;
|
||||
@@ -297,79 +292,80 @@ static char *ExchangeChars(char *s, bool ToFileSystem)
|
||||
{
|
||||
char *p = s;
|
||||
while (*p) {
|
||||
#ifdef VFAT
|
||||
// The VFAT file system can't handle all characters, so we
|
||||
// have to take extra efforts to encode/decode them:
|
||||
if (ToFileSystem) {
|
||||
switch (*p) {
|
||||
// characters that can be used "as is":
|
||||
case '!':
|
||||
case '@':
|
||||
case '$':
|
||||
case '%':
|
||||
case '&':
|
||||
case '(':
|
||||
case ')':
|
||||
case '+':
|
||||
case ',':
|
||||
case '-':
|
||||
case ';':
|
||||
case '=':
|
||||
case '0' ... '9':
|
||||
case 'a' ... 'z':
|
||||
case 'A' ... 'Z':
|
||||
case '<EFBFBD>': case '<EFBFBD>':
|
||||
case '<EFBFBD>': case '<EFBFBD>':
|
||||
case '<EFBFBD>': case '<EFBFBD>':
|
||||
case '<EFBFBD>':
|
||||
break;
|
||||
// characters that can be mapped to other characters:
|
||||
case ' ': *p = '_'; break;
|
||||
case '~': *p = '/'; break;
|
||||
// characters that have to be encoded:
|
||||
default:
|
||||
if (*p != '.' || !*(p + 1) || *(p + 1) == '~') { // Windows can't handle '.' at the end of directory names
|
||||
int l = p - s;
|
||||
s = (char *)realloc(s, strlen(s) + 10);
|
||||
p = s + l;
|
||||
char buf[4];
|
||||
sprintf(buf, "#%02X", (unsigned char)*p);
|
||||
memmove(p + 2, p, strlen(p) + 1);
|
||||
strncpy(p, buf, 3);
|
||||
p += 2;
|
||||
}
|
||||
}
|
||||
if (VfatFileSystem) {
|
||||
// The VFAT file system can't handle all characters, so we
|
||||
// have to take extra efforts to encode/decode them:
|
||||
if (ToFileSystem) {
|
||||
switch (*p) {
|
||||
// characters that can be used "as is":
|
||||
case '!':
|
||||
case '@':
|
||||
case '$':
|
||||
case '%':
|
||||
case '&':
|
||||
case '(':
|
||||
case ')':
|
||||
case '+':
|
||||
case ',':
|
||||
case '-':
|
||||
case ';':
|
||||
case '=':
|
||||
case '0' ... '9':
|
||||
case 'a' ... 'z':
|
||||
case 'A' ... 'Z':
|
||||
case '<EFBFBD>': case '<EFBFBD>':
|
||||
case '<EFBFBD>': case '<EFBFBD>':
|
||||
case '<EFBFBD>': case '<EFBFBD>':
|
||||
case '<EFBFBD>':
|
||||
break;
|
||||
// characters that can be mapped to other characters:
|
||||
case ' ': *p = '_'; break;
|
||||
case '~': *p = '/'; break;
|
||||
// characters that have to be encoded:
|
||||
default:
|
||||
if (*p != '.' || !*(p + 1) || *(p + 1) == '~') { // Windows can't handle '.' at the end of directory names
|
||||
int l = p - s;
|
||||
s = (char *)realloc(s, strlen(s) + 10);
|
||||
p = s + l;
|
||||
char buf[4];
|
||||
sprintf(buf, "#%02X", (unsigned char)*p);
|
||||
memmove(p + 2, p, strlen(p) + 1);
|
||||
strncpy(p, buf, 3);
|
||||
p += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch (*p) {
|
||||
// mapped characters:
|
||||
case '_': *p = ' '; break;
|
||||
case '/': *p = '~'; break;
|
||||
// encodes characters:
|
||||
case '#': {
|
||||
if (strlen(p) > 2) {
|
||||
char buf[3];
|
||||
sprintf(buf, "%c%c", *(p + 1), *(p + 2));
|
||||
unsigned char c = strtol(buf, NULL, 16);
|
||||
*p = c;
|
||||
memmove(p + 1, p + 3, strlen(p) - 2);
|
||||
}
|
||||
}
|
||||
break;
|
||||
// backwards compatibility:
|
||||
case '\x01': *p = '\''; break;
|
||||
case '\x02': *p = '/'; break;
|
||||
case '\x03': *p = ':'; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch (*p) {
|
||||
// mapped characters:
|
||||
case '_': *p = ' '; break;
|
||||
case '/': *p = '~'; break;
|
||||
// encodes characters:
|
||||
case '#': {
|
||||
if (strlen(p) > 2) {
|
||||
char buf[3];
|
||||
sprintf(buf, "%c%c", *(p + 1), *(p + 2));
|
||||
unsigned char c = strtol(buf, NULL, 16);
|
||||
*p = c;
|
||||
memmove(p + 1, p + 3, strlen(p) - 2);
|
||||
}
|
||||
}
|
||||
for (struct tCharExchange *ce = CharExchange; ce->a && ce->b; ce++) {
|
||||
if (*p == (ToFileSystem ? ce->a : ce->b)) {
|
||||
*p = ToFileSystem ? ce->b : ce->a;
|
||||
break;
|
||||
// backwards compatibility:
|
||||
case '\x01': *p = '\''; break;
|
||||
case '\x02': *p = '/'; break;
|
||||
case '\x03': *p = ':'; break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
for (struct tCharExchange *ce = CharExchange; ce->a && ce->b; ce++) {
|
||||
if (*p == (ToFileSystem ? ce->a : ce->b)) {
|
||||
*p = ToFileSystem ? ce->b : ce->a;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
p++;
|
||||
}
|
||||
return s;
|
||||
@@ -500,6 +496,20 @@ cRecording::cRecording(const char *FileName)
|
||||
data[2] = data[1];
|
||||
data[1] = NULL;
|
||||
}
|
||||
else if (line == 2) {
|
||||
// if line 1 is too long, it can't be the short text,
|
||||
// so assume the short text is missing and concatenate
|
||||
// line 1 and line 2 to be the long text:
|
||||
int len = strlen(data[1]);
|
||||
if (len > 80) {
|
||||
data[1] = (char *)realloc(data[1], len + 1 + strlen(data[2]) + 1);
|
||||
strcat(data[1], "\n");
|
||||
strcat(data[1], data[2]);
|
||||
free(data[2]);
|
||||
data[2] = data[1];
|
||||
data[1] = NULL;
|
||||
}
|
||||
}
|
||||
info->SetData(data[0], data[1], data[2]);
|
||||
for (int i = 0; i < 3; i ++)
|
||||
free(data[i]);
|
||||
|
||||
Reference in New Issue
Block a user