diff -ruNbw vdr-1.2.2/CONTRIBUTORS vdr-1.2.5/CONTRIBUTORS
--- vdr-1.2.2/CONTRIBUTORS	Sat Aug  2 16:32:53 2003
+++ vdr-1.2.5/CONTRIBUTORS	Sun Sep 14 13:17:07 2003
@@ -315,6 +315,10 @@
  for suggesting a confirmation prompt when the user presses the "Power" button
  and there is an upcoming timer event
  for reporting a bug in skipping the next hit of a repeating timer
+ for reporting a problem with staying off the end of an ongoing recording while
+ replaying in time shift mode
+ for suggesting that VDR should stop if one of the configuration files can't be
+ read correctly at program startup
 
 Oleg Assovski <assen@bitcom.msk.ru>
  for adding EPG scanning for another 4 days
@@ -328,6 +332,9 @@
 Mirko Günther <mi.guenther@ib-helms.de>
  for suggesting the -m command line option
  for suggesting the SVDRP command VOLU
+ for reporting a bug in keeping track of the current channel number when moving
+ channels in the "Channels" menu
+ for reporting a bug in toggling channels with the '0' key
 
 Achim Lange <Achim_Lange@t-online.de>
  for replacing 'killproc' with 'killall' in 'runvdr' to make it work on Debian
@@ -450,6 +457,7 @@
 
 Helmut Auer <vdr@helmutauer.de>
  for reporting a superfluous error message in cLockFile
+ for suggesting to make the "Zap timeout" a setup variable
 
 Jeremy Hall <jhall@UU.NET>
  for fixing an incomplete initialization of the filter parameters in eit.c
@@ -481,6 +489,12 @@
  the remote control keys
  for reporting a bug in reading 'epg.data' for channels with non-zero RID
  for fixing I/O handling in case an explicit controlling terminal is given
+ for fixing displaying still pictures, now using the driver's VIDEO_STILLPICTURE call
+ directly
+ for reporting and helping to debug dropping out of replay mode while viewing a
+ recording that is still going on
+ for fixing checking for VIDEO_STREAM_S in cRemux::SetBrokenLink()
+ for suggesting to add 'repeat' function keys '7' and '9'
 
 Reinhard Walter Buchner <rw.buchner@freenet.de>
  for adding some satellites to 'sources.conf'
@@ -536,6 +550,8 @@
  for reporting a bug in switching audio tracks in 'Transfer Mode' on the primary DVB device
  for making the program use the values of VIDEODIR and PLUGINDIR defined in Makefile
  or Makefile.config as defaults
+ for helping to debug a crash when using the --terminal option without having access
+ to the given terminal
 
 Peter Seyringer <e9425234@student.tuwien.ac.at>
  for reporting a bug in saving the polarization parameter of channels that have a
@@ -550,6 +566,8 @@
 
 Andreas Kool <akool@akool.de>
  for his help in keeping 'channels.conf.cable' up to date
+ for fixing the TS to PES repacker so that it works with MPEG1 streams
+ for reporting a problem with empty values in setup.conf
 
 Guy Roussin <guy.roussin@teledetection.fr>
  for suggesting not to display channel group delimiters without text
@@ -583,6 +601,8 @@
 
 Jan Rieger <jan@ricomp.de>
  for suggestions and testing raw keyboard input
+ for suggesting to make cOsdMenu::Display() virtual, which allows plugins to do some
+ additional processing after calling the base class function
 
 Walter Stroebel <walter.stroebel@lifeline.nl>
  for introducing "Doxygen" to document the VDR source code
@@ -612,6 +632,7 @@
  for fixing a possible deadlock when using the "Blue" button in the "Schedules" menu
  to switch to an other channel
  for reporting a wrong EPG bugfix code number for the MAX_USEFUL_SUBTITLE_LENGTH fix
+ for fixing a bug in resetting OSD color palettes
 
 Steffen Becker <stbecker@rbg.informatik.tu-darmstadt.de>
  for reporting a problem with CPU load peaks (in the EPG scanner)
@@ -637,6 +658,7 @@
  for fixing handling repeat function with LIRC
  for reporting a problem with the LIRC remote control trying to learn keys even if it
  couldn't connect to the LIRC daemon
+ for making the plugin library directory configurable via Make.config
 
 Thomas Koch <tom@harhar.net>
  for his support in keeping the Premiere World channels up to date in 'channels.conf'
@@ -689,6 +711,7 @@
 Alfred Zastrow <vdr@zastrow4u.de>
  for suggesting to implement separate PausePriority and PauseLifetime parameters for
  the recordings created when pausing live video
+ for reporting two warnings when compiling with gcc 3.3.1
 
 Matthias Raus <matthias-raus@web.de>
  for reporting a problem with starting the editing process if no marks have been set
@@ -728,6 +751,7 @@
 
 Thomas Schmidt <thomas.schmidt@in.stud.tu-ilmenau.de>
  for reporting a crash when cancelling a newly created timer
+ for making 'diseqc.conf' a required file only if Setup.DiSEqC is activated
 
 Michael Walle <michael.walle@web.de>
  for reporting a bug in channel switching after Left/Right has been pressed
@@ -737,6 +761,7 @@
  that a channel only qualifies as "previous" if it has been selected for at least
  3 seconds
  for reporting a bug in handling the color buttons in the "Edit channel" menu
+ for adding a note about the config files of plugins to INSTALL
 
 Kenneth Aafløy <ke-aa@frisurf.no>
  for fixing checking CA capabilities with the dvb-kernel driver
@@ -744,3 +769,55 @@
 Ernst Fürst <ernstfuerst@swissonline.ch>
  for reporting a crash in case a VFAT file system is used without compiling VDR
  with VFAT=1
+
+Reinhard Nissl <rnissl@gmx.de>
+ for reporting a name clash because of function crc32() in libdtv/libsi/si_parser.c
+ when using other libraries that also implement a function by that name
+ for reporting a bug in handling ':' characters in channel names when reading
+ channels.conf
+
+Richard Robson <richard_robson@beeb.net>
+ for reporting freezing replay if a timer starts while in Transfer Mode from the
+ device used by the timer, and the timer needs a different transponder
+
+Manfred Schmidt-Voigt <manfred.schmidt-voigt@mannitec.de>
+ for reporting a problem with runnign out of disk space while cutting in case
+ there are still deleted recordings to remove
+
+Javier Marcet <lists@marcet.info>
+ for reporting a problem when starting a recording on the primary device if there
+ is a replay session active
+
+Peter Waechtler <pwaechtler@mac.com>
+ for adding channels for DVB-T Hannover (Germany) to channels.cont.terr
+
+Robert Bartl <robert@bartl.priv.at>
+ for reporting a hangup in SVDRP when the client disappears without sending QUIT
+
+Sebastian Frei <sebastian@schnapsleichen.de>
+ for his support in keeping 'channels.conf' up-to-date.
+
+Rene Bartsch <ml@bartschnet.de>
+ for reporting a bug in setting the primary device in case none of the devices
+ provides an MPEG decoder
+
+Christoph Hermanns <christoph.hermanns@gmx.de>
+ for reporting a bug in handling the "Red" button in the "Schedules" menu in case
+ there are no events listed for a particular channel
+
+Oskar Signell <oskar@signell.net>
+ for pointing out a problem with setting an editing mark while in "Pause" mode,
+ where replay was not immediately positioned to the marked frame
+
+Dirk Essl <de@floydworld.de>
+ for reporting a wrong URL to the 'Doxygen' tool in INSTALL
+
+Hans Dingemans <hans.dingemans@tacticalops.nl>
+ for translating OSD texts to the Dutch language
+
+Alexander Wetzel <alexander.wetzel@web.de>
+ for suggesting to let VDR start up even if 'keymacros.conf' references a plugin
+ that is currently not loaded
+
+Marco Franceschetti <ordaz@quipo.it>
+ for updating 'ca.conf'
diff -ruNbw vdr-1.2.2/HISTORY vdr-1.2.5/HISTORY
--- vdr-1.2.2/HISTORY	Sun Aug  3 11:54:18 2003
+++ vdr-1.2.5/HISTORY	Wed Sep 17 18:12:38 2003
@@ -2282,3 +2282,123 @@
 - Now the program uses the values of VIDEODIR and PLUGINDIR defined in Makefile
   or Makefile.config as defaults (thanks to Steffen Barszus).
 - Added the usual menu timeout to the CAM menus.
+
+2003-08-17: Version 1.2.3 (not officially released)
+
+- Fixed the TS to PES repacker so that it works with MPEG1 streams (thanks to
+  Andreas Kool).
+- Fixed keeping track of the current channel number when moving channels in
+  the "Channels" menu (thanks to Mirko Günther for reporting this one).
+- Made the plugin library directory configurable via Make.config (thanks to
+  Ludwig Nussel).
+- Fixed scaling SPU bitmaps in Letterbox mode when playing NTSC material.
+  In order to do this, the cDevice was given a new member function GetVideoSystem().
+- Fixed two warnings when compiling with gcc 3.3.1 (thanks to Alfred Zastrow for
+  reporting this).
+- Made crc32() a static function in libdtv/libsi/si_parser.c to avoid a name clash
+  when using other libraries that also implement a function by that name (thanks
+  to Reinhard Nissl for reporting this one).
+- Fixed staying off the end of an ongoing recording while replaying in time shift
+  mode (thanks to Rainer Zocholl for reporting this one).
+- VDR now stops with exit status 2 if one of the configuration files can't be
+  read correctly at program startup (suggested by Rainer Zocholl).
+- Fixed a crash when starting "Pause live video" twice within the same minute on
+  the same channel.
+- Fixed freezing replay if a timer starts while in Transfer Mode from the device
+  used by the timer, and the timer needs a different transponder (thanks to
+  Richard Robson for reporting this one).
+- Fixed toggling channels with the '0' key (thanks to Mirko Günther for reporting
+  this one).
+- Made the "Zap timeout" (the time until a channel counts as "previous" for
+  switching with '0') a setup variable, available in "Setup/Miscellaneous"
+  (suggested by Helmut Auer).
+- Removing deleted recordings faster than normal when cutting, to avoid running
+  out of disk space (thanks to Manfred Schmidt-Voigt for reporting this one).
+
+2003-08-26: Version 1.2.4 (not officially released)
+
+- Fixed 'runvdr' to stay in the loop only if VDR returns an exit status of '1'.
+- Completed the Finnish OSD texts (thanks to Rolf Ahrenberg).
+- Empty values in setup.conf are no longer treated as an error (thanks to Andreas
+  Kool for reporting this one).
+- Added a note about the config files of plugins to INSTALL (thanks to Thomas
+  Keil).
+- VDR now continues to start up, even if there is an error in setup.conf.
+- Fixed a bug in resetting OSD color palettes (thanks to Torsten Herz).
+- Fixed starting a recording on the primary device if there is a replay session
+  active (thanks to Javier Marcet for reporting this one).
+- Avoiding an unnecessary stop of an ongoing Transfer Mode when starting a
+  recording on the primary device.
+
+2003-08-31: Version 1.2.5pre1
+
+- Now explicitly handling exit value 0 and 2 in 'runvdr'.
+- Added a missing 'w' to the allowed characters for Finnish and Swedish (thanks
+  to Lauri Tischler and Ragnar Sundblad).
+- Added channels for DVB-T Hannover (Germany) to channels.cont.terr (thanks to
+  Peter Waechtler).
+- Fixed a hangup in SVDRP when the client disappears without sending QUIT (thanks
+  to Robert Bartl for reporting this one). The problem was introduced in version
+  1.2.2 through the fix for an occasional "Broken pipe" error in SVDRP connections.
+- Updated 'channels.conf.terr' for Berlin.
+- Fixed displaying still pictures, now using the driver's VIDEO_STILLPICTURE call
+  directly (thanks to Oliver Endriss). This also improves navigating through DVD
+  menus with the DVD plugin. If this causes problems with your particular system
+  (maybe because you are using the 'analogtv' plugin) you can reactivate the
+  previous behaviour by commenting out the line
+  #define VIDEO_STILLPICTURE_WORKS_WITH_VDR_FRAMES
+  in VDR/dvbdevice.c.
+  Note that you need driver version 2003-08-23 or later for this to work!
+- Fixed handling extra blanks in plugin command lines.
+- Actually implemented the SVDRP command DELC.
+- Now clearing the player device if there are too many poll timeouts in 'Transfer
+  Mode', which avoids buffer overflows and black screens in such cases.
+
+2003-09-07: Version 1.2.5pre2
+
+- Updated VIVA, VIVA Plus, MTV Central and MTV 2 in channels.conf (thanks to
+  Sebastian Frei).
+- Changed "Studio Universal" to "Sci-Fi" in channels.conf.
+- Fixed a crash when using the --terminal option without having access to the
+  given terminal (thanks to Steffen Barszus for helping to debug this one).
+- Added a note about the driver version needed for the still picture fix from
+  version 1.2.5pre1 to work properly (thanks to Oliver Endriss for pointing
+  this out).
+- Fixed setting the primary device in case none of the devices provides an MPEG
+  decoder (thanks to Rene Bartsch for reporting this one).
+- Fixed handling the "Red" button in the "Schedules" menu in case there are no
+  events listed for a particular channel (thanks to Christoph Hermanns for
+  reporting this one).
+- When setting an editing mark while in "Pause" mode, replay now immediately
+  jumps to the marked frame (thanks to Oskar Signell for pointing out this
+  problem).
+- The DVB devices no longer send CA descriptors to the CAM while the EPG scanner
+  is active (sometimes the CAMs got irritated when the device tuned to channels
+  they couldn't handle).
+
+2003-09-14: Version 1.2.5pre3
+
+- Fixed dropping out of replay mode while viewing a recording that is still
+  going on (thanks to Oliver Endriss for reporting and helping to debug this
+  one).
+- Fixed handling ':' characters in channel names when reading channels.conf
+  (thanks to Reinhard Nissl for reporting this one).
+- Fixed the URL to the 'Doxygen' tool in INSTALL (thanks to Dirk Essl).
+- Removed the obsolete chapter "Stopping a recording on the primary DVB interface"
+  from MANUAL.
+- Completed dutch language texts (thanks to Hans Dingemans).
+- Made 'diseqc.conf' a required file only if Setup.DiSEqC is activated (thanks to
+  Thomas Schmidt).
+- VDR now starts up even if 'keymacros.conf' references a plugin that is currently
+  not loaded (suggested by Alexander Wetzel).
+- Fixed checking for VIDEO_STREAM_S in cRemux::SetBrokenLink() (thanks to Oliver
+  Endriss).
+- Added 'repeat' function keys '7' and '9' ("jump to mark") in replay mode
+  (suggested by Oliver Endriss).
+- Made cOsdMenu::Display() virtual, which allows plugins to do some additional
+  processing after calling the base class function (suggested by Jan Rieger).
+- Updated 'ca.conf' (thanks to Marco Franceschetti).
+
+2003-09-17: Version 1.2.5
+
+- Updated 'channels.conf.cable' (thanks to Stefan Hußfeldt).
diff -ruNbw vdr-1.2.2/INSTALL vdr-1.2.5/INSTALL
--- vdr-1.2.2/INSTALL	Sat May 31 18:20:59 2003
+++ vdr-1.2.5/INSTALL	Tue Sep  9 21:02:13 2003
@@ -302,8 +302,11 @@
 There are several configuration files that hold information about
 channels, remote control keys, timers etc. By default these files are
 assumed to be located in the video directory, but a different directory
-can be used with the '-c' option. For starters just copy all *.conf files from
-the VDR directory into your video directory.
+can be used with the '-c' option. Plugins assume their configuration files
+in a subdirectory called "plugins" of this directory.
+
+For starters just copy all *.conf files from the VDR directory into your
+video directory.
 
 The configuration files can be edited with any text editor, or will be written
 by the 'vdr' program if any changes are made inside the on-screen menus.
@@ -379,7 +382,7 @@
 -------------------------------------
 
 You can do a 'make srcdoc' to generate source code documentation using the
-Doxygen tool. To do so you need the Doxygen package from http://www.doxygen.src
+Doxygen tool. To do so you need the Doxygen package from http://www.doxygen.org
 and the Graphviz package from http://www.research.att.com/sw/tools/graphviz.
 After installing these two packages you can do 'make srcdoc' and then use your
 HTML browser to read srcdoc/html/index.html.
diff -ruNbw vdr-1.2.2/MANUAL vdr-1.2.5/MANUAL
--- vdr-1.2.2/MANUAL	Sun Jun 15 16:35:38 2003
+++ vdr-1.2.5/MANUAL	Tue Sep  9 23:38:19 2003
@@ -393,20 +393,6 @@
   A timer can also be programmed by pressing the "Red" button on the "Schedule",
   "Now", "Next" or "Event" menus.
 
-* Stopping a recording on the primary DVB interface
-
-  If the primary DVB interface is currently recording, the user can't switch
-  the channel or replay another recording on that interface. However, if there
-  is an other DVB interface that is currently not recording and provides the
-  necessary conditional access facilities to continue the recording that is
-  currently being performed on the primary DVB interface, the "VDR" menu will
-  contain an option that allows you to stop recording on the primary DVB
-  interface. Select that option to stop the ongoing recording and thus free the
-  primary DVB interface to allow channel switching or replaying. The interrupted
-  recording will be continued on an other free DVB interface. There may be a
-  short discontinuity at that point when replaying that recording later, so you
-  may want to place such an action for instance in a commercial break.
-
 * Parameters in the "Setup" menu
 
   Select "Setup" from the "VDR" menu to enter the setup menu. From there you can
@@ -634,6 +620,9 @@
   SVDRP timeout = 300    The time (in seconds) of inactivity on an open SVDRP
                          connection after which the connection is automatically
                          closed. Default is 300, a value of 0 means no timeout.
+
+  Zap Timeout = 3        The time (in seconds) until a channel counts as "previous"
+                         for switching with '0'
 
 * Executing system commands
 
diff -ruNbw vdr-1.2.2/Make.config.template vdr-1.2.5/Make.config.template
--- vdr-1.2.2/Make.config.template	Sat Aug  2 16:25:53 2003
+++ vdr-1.2.5/Make.config.template	Sat Aug  9 13:03:25 2003
@@ -6,7 +6,7 @@
 # See the main source file 'vdr.c' for copyright information and
 # how to reach the author.
 #
-# $Id: Make.config.template 1.2 2003/08/02 14:25:53 kls Exp $
+# $Id: Make.config.template 1.3 2003/08/09 11:03:25 kls Exp $
 
 ### The C compiler and options:
 
@@ -23,4 +23,5 @@
 BINDIR   = /usr/local/bin
 
 PLUGINDIR= ./PLUGINS
+PLUGINLIBDIR= $(PLUGINDIR)/lib
 VIDEODIR = /video
diff -ruNbw vdr-1.2.2/Makefile vdr-1.2.5/Makefile
--- vdr-1.2.2/Makefile	Sat Aug  2 16:27:21 2003
+++ vdr-1.2.5/Makefile	Sat Aug  9 13:09:45 2003
@@ -4,7 +4,7 @@
 # See the main source file 'vdr.c' for copyright information and
 # how to reach the author.
 #
-# $Id: Makefile 1.57 2003/08/02 14:27:21 kls Exp $
+# $Id: Makefile 1.58 2003/08/09 11:09:45 kls Exp $
 
 .DELETE_ON_ERROR:
 
@@ -20,6 +20,7 @@
 BINDIR   = /usr/local/bin
 
 PLUGINDIR= ./PLUGINS
+PLUGINLIBDIR= $(PLUGINDIR)/lib
 
 VIDEODIR = /video
 
@@ -50,7 +51,7 @@
 DEFINES += -D_GNU_SOURCE
 
 DEFINES += -DVIDEODIR=\"$(VIDEODIR)\"
-DEFINES += -DPLUGINDIR=\"$(PLUGINDIR)/lib\"
+DEFINES += -DPLUGINDIR=\"$(PLUGINLIBDIR)\"
 
 ifdef DEBUG_OSD
 DEFINES += -DDEBUG_OSD
@@ -115,7 +116,7 @@
 
 plugins-clean:
 	@for i in `ls $(PLUGINDIR)/src | grep -v '[^a-z0-9]'`; do $(MAKE) -C "$(PLUGINDIR)/src/$$i" clean; done
-	@-rm -f $(PLUGINDIR)/lib/*
+	@-rm -f $(PLUGINLIBDIR)/*
 
 # Install the files:
 
diff -ruNbw vdr-1.2.2/ca.conf vdr-1.2.5/ca.conf
--- vdr-1.2.2/ca.conf	Sun Jan 12 10:43:08 2003
+++ vdr-1.2.5/ca.conf	Sun Sep 14 13:14:03 2003
@@ -31,6 +31,7 @@
 404    Parabole Reunion
 405    Hrvatska radiotelevizija
 406    RTV Slovenija
+407    Visat
 
 # Viaccess 2
 
@@ -52,6 +53,7 @@
 # Nagravision
 
 901    PolSat Cyfrowy
+902    TV Cabo
 
 # Irdeto 2
 
@@ -68,13 +70,9 @@
 10001  AB Sat France
 10002  TPS France
 
-# Videoguard, Mediaguard 2, Irdeto 1
+# Videoguard, Mediaguard 2, Irdeto 2
 
-11001  Stream TV Italy
-
-# Videoguard, Mediaguard 2, Cryptoworks
-
-12001  Tele+ Digitale
+12001  Sky Italia
 
 # Mediaguard 1, Irdeto 1
 
@@ -84,9 +82,9 @@
 
 14001  Canal Satellite France
 
-# Mediaguard 1, Mediaguard 2, Viaccess 1, Cryptoworks
+# Mediaguard 2, Nagravision
 
-15001  Canal Satelite Digital Espana
+15001  Digital+ Espana
 
 # Mediaguard 2, Cryptoworks
 
diff -ruNbw vdr-1.2.2/channels.c vdr-1.2.5/channels.c
--- vdr-1.2.2/channels.c	Sat Apr 26 11:57:48 2003
+++ vdr-1.2.5/channels.c	Tue Sep  9 20:55:26 2003
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: channels.c 1.12 2003/04/26 09:57:48 kls Exp $
+ * $Id: channels.c 1.14 2003/09/09 18:55:26 kls Exp $
  */
 
 #include "channels.h"
@@ -315,6 +315,7 @@
 
 bool cChannel::Parse(const char *s, bool AllowNonUniqueID)
 {
+  bool ok = true;
   if (*s == ':') {
      groupSep = true;
      if (*++s == '@' && *++s) {
@@ -346,7 +347,7 @@
         vpid  = ppid  = 0;
         apid1 = apid2 = 0;
         dpid1 = dpid2 = 0;
-        bool ok = false;
+        ok = false;
         if (parambuf && sourcebuf && vpidbuf && apidbuf) {
            ok = StringToParameters(parambuf) && (source = cSource::FromString(sourcebuf)) >= 0;
            char *p = strchr(vpidbuf, '+');
@@ -372,13 +373,12 @@
            esyslog("ERROR: channel data not unique!");
            return false;
            }
-        return ok;
         }
      else
         return false;
      }
   strreplace(name, '|', ':');
-  return true;
+  return ok;
 }
 
 bool cChannel::Save(FILE *f)
@@ -390,9 +390,9 @@
 
 cChannels Channels;
 
-bool cChannels::Load(const char *FileName, bool AllowComments)
+bool cChannels::Load(const char *FileName, bool AllowComments, bool MustExist)
 {
-  if (cConfig<cChannel>::Load(FileName, AllowComments)) {
+  if (cConfig<cChannel>::Load(FileName, AllowComments, MustExist)) {
      ReNumber();
      return true;
      }
diff -ruNbw vdr-1.2.2/channels.conf vdr-1.2.5/channels.conf
--- vdr-1.2.2/channels.conf	Sun Jun 22 15:41:17 2003
+++ vdr-1.2.5/channels.conf	Fri Sep  5 14:46:20 2003
@@ -56,7 +56,7 @@
 Premiere 6:11797:h:S19.2E:27500:1535:1536:0:101:41:0:0:0
 Premiere 7:11797:h:S19.2E:27500:1023:1024:0:101:20:0:0:0
 13th Street:11758:h:S19.2E:27500:2303:2304:0:101:42:0:0:0
-Studio Universal:11798:h:S19.2E:27500:2047:2048:0:101:36:0:0:0
+Sci-Fi:11758:h:S19.2E:27500:2047:2048:0:101:36:0:0:0
 Premiere Serie:12031:h:S19.2E:27500:1023:1024:0:101:16:0:0:0
 Disney Channel:11758:h:S19.2E:27500:2559:2560:0:101:34:0:0:0
 Premiere Nostalgie:12031:h:S19.2E:27500:2559:2560:0:101:516:0:0:0
@@ -145,13 +145,13 @@
 RTL Tele Letzebuerg:12552:v:S19.2E:22000:168:144,146:0:0:3994:0:0:0
 VERONICA:12574:h:S19.2E:22000:161:84:0:0:5010:0:0:0
 VH1 Classic:12670:v:S19.2E:22000:3071:3072:0:0:28647:0:0:0
-MTV 2 Pop:12670:v:S19.2E:22000:3081:3082:0:0:28648:0:0:0
+MTV 2:12225:h:S19.2E:27500:513:661:577:0:28640:0:0:0
 Via 1 - Schöner Reisen:12148:h:S19.2E:27500:511:512:0:0:44:0:0:0
 Video Italia:12610:v:S19.2E:22000:121:122:0:0:12220:0:0:0
 ORF/ZDF:12670:h:S19.2E:22000:506:507:0:0:13012:0:0:0
-VIVA:12670:v:S19.2E:22000:309:310:0:0:12732:0:0:0
-VIVA PLUS:12552:v:S19.2E:22000:171:172:0:0:12120:0:0:0
-MTV German:12670:v:S19.2E:22000:3031:3032:0:0:28643:0:0:0
+VIVA:12670:v:S19.2E:22000:309:310:311:0:12732:0:0:0
+VIVA PLUS:12552:v:S19.2E:22000:171:172:179:0:12120:0:0:0
+MTV Central:11739:v:S19.2E:27500:3031:3032:3034:0:28653:0:0:0
 QVC Germany:12552:v:S19.2E:22000:165:166:0:0:12100:0:0:0
 Tele 5:12480:v:S19.2E:27500:1535:1536:0:0:51:0:0:0
 :@201 Sky
diff -ruNbw vdr-1.2.2/channels.conf.cable vdr-1.2.5/channels.conf.cable
--- vdr-1.2.2/channels.conf.cable	Sun May 18 14:58:59 2003
+++ vdr-1.2.5/channels.conf.cable	Wed Sep 17 18:10:06 2003
@@ -14,8 +14,8 @@
 CNBC:394:M64:C:6900:510:520:530:0:28010:0:0:0
 Eurosport:394:M64:C:6900:410:420:430:0:28009:0:0:0
 :Regionalprogramme
-SFB1:426:M64:C:6900:601:602:604:0:28206:0:0:0
-ORB-Fernsehen:426:M64:C:6900:501:502:504:0:28205:0:0:0
+RBB Berlin:426:M64:C:6900:601:602:604:0:28206:0:0:0
+RBB Brandenburg:426:M64:C:6900:501:502:504:0:28205:0:0:0
 N3:426:M64:C:6900:2401:2402:2404:0:28224:0:0:0
 MDR FERNSEHEN:426:M64:C:6900:401:402:404:0:28204:0:0:0
 WDR FERNSEHEN:410:M64:C:6900:601:602:604:0:28111:0:0:0
@@ -23,8 +23,8 @@
 BR-alpha:410:M64:C:6900:701:702:704:0:28112:0:0:0
 Bayerisches FS:410:M64:C:6900:201:202:125:0:28107:0:0:0
 SR Fernsehen Suedwest:410:M64:C:6900:501:502:504:0:28110:0:0:0
-SuedWest BW:410:M64:C:6900:801:802:804:0:28113:0:0:0
-SuedWest RP:426:M64:C:6900:3101:3102:3104:0:28231:0:0:0
+SÜDWEST BW:410:M64:C:6900:801:802:804:0:28113:0:0:0
+SÜDWEST RP:426:M64:C:6900:3101:3102:3104:0:28231:0:0:0
 :Hauptprogramme Premiere
 PREMIERE START:370:M64:C:6900:255:256:32:101:8:0:0:0
 PREMIERE 1:370:M64:C:6900:511:512;515:0:101:10:0:0:0
@@ -35,16 +35,16 @@
 PREMIERE 6:370:M64:C:6900:1535:1536:0:101:41:0:0:0
 PREMIERE 7:370:M64:C:6900:1023:1024:0:101:20:0:0:0
 PREMIERE SERIE:378:M64:C:6900:1023:1024:0:101:16:0:0:0
-PREMIERE Nostalgie:378:M64:C:6900:2559:2560:0:101:516:0:0:0
+PREMIERE NOSTALGIE:378:M64:C:6900:2559:2560:0:101:516:0:0:0
 13 TH STREET:354:M64:C:6900:2303:2304:0:101:42:0:0:0
-STUDIO UNIVERSAL:354:M64:C:6900:2047:2048:0:101:36:0:0:0
+SCI FI:354:M64:C:6900:2047:2048:0:101:36:0:0:0
 MGM:354:M64:C:6900:767:768,769:0:101:515:0:0:0
 PREMIERE KRIMI:378:M64:C:6900:1535:1536:0:101:23:0:0:0
-Disney Channel:354:M64:C:6900:2559:2560:0:101:34:0:0:0
+DISNEY CHANNEL:354:M64:C:6900:2559:2560:0:101:34:0:0:0
 DISCOVERY CHANNEL:354:M64:C:6900:1023:1024:0:101:14:0:0:0
 PLANET:354:M64:C:6900:1535:1536:0:101:13:0:0:0
-Fox Kids:354:M64:C:6900:1279:1280:0:101:28:0:0:0
-Junior:354:M64:C:6900:255:256:0:101:19:0:0:0
+FOX KIDS:354:M64:C:6900:1279:1280:0:101:28:0:0:0
+JUNIOR:354:M64:C:6900:255:256:0:101:19:0:0:0
 HEIMATKANAL:386:M64:C:6900:1279:1280:0:101:22:0:0:0
 GOLDSTAR TV:386:M64:C:6900:3839:3840:0:101:518:0:0:0
 CLASSICA:386:M64:C:6900:767:768:0:101:15:0:0:0
@@ -73,47 +73,53 @@
 PREMIERE EROTIK 2:386:M64:C:6900:1535:1536:0:101:778:0:0:0
 PREMIERE EROTIK 3:386:M64:C:6900:1791:1792:0:101:779:0:0:0
 PREMIERE EROTIK 4:386:M64:C:6900:3583:3584:0:101:780:0:0:0
-:NEU
-Test-R:410:M64:C:6900:701:702:125:0:28130:0:0:0
-Test-R:410:M64:C:6900:901:902:125:0:28130:0:0:1
-ARD-Online-Kanal:426:M64:C:6900:0:1801,1805:0:101:28218:0:0:0
-TestS33:402:M64:C:6900:1211:1212:0:101:53001:0:0:0
-Test S 38:442:M64:C:6900:513:514:0:101:53301:0:0:0
+:TESTS
+Test-R:410:M64:C:6900:201:202:204:0:28130:0:0:0
+Test-R:410:M64:C:6900:701:702:125:0:28130:0:0:1
+Test-R:410:M64:C:6900:901:902:125:0:28130:0:0:2
+Test S38 D442 TP B9:442:M64:C:6900:513:514:0:101:53301:0:0:0
+Test S 26:346:M64:C:6900:811:812:0:101:50701:0:0:0
+ARD-MHP-TEST-5:426:M64:C:6900:101:102:0:0:28221:0:0:0
+ARD-Online-Kanal:426:M64:C:6900:0:1801,1807:0:0:28218:0:0:0
+DPC.TV 1:346:M64:C:6900:821:822:0:101:658:0:0:0
+DPC.TV 2:346:M64:C:6900:831:832:0:101:659:0:0:0
+[00d5]:354:M64:C:6900:1791:0:0:0:213:0:0:0
+[0309]:386:M64:C:6900:255:256:0:0:777:0:0:0
 :DIGIKABEL D
 Club:113:M64:C:6900:711:712,713:0:101:53401:0:0:0
 Liberty TV:113:M64:C:6900:721:722,723:0:101:53402:0:0:0
 Einstein TV:113:M64:C:6900:701:702:0:101:53410:0:0:0
 BibelTV:113:M64:C:6900:731:732:0:101:53403:0:0:0
-Avante:113:M64:C:6900:741:742,743:0:101:53404:0:0:0
 TW1:113:M64:C:6900:751:752:753:101:53405:0:0:0
-:DIGIKABEL INT
 Extreme Sports:113:M64:C:6900:791:792,793:0:101:53409:0:0:0
+:DIGIKABEL INT
 BBC Prime:113:M64:C:6900:761:762:763:101:53406:0:0:0
 Eurosport News:113:M64:C:6900:771:772:774:101:53407:0:0:0
 MTV Base:113:M64:C:6900:781:782:0:101:53408:0:0:0
-ATV 2:434:M64:C:6900:631:632:633:101:53203:0:0:0
+ERT-Sat:434:M64:C:6900:691:692:693:101:53209:0:0:0
+PCNE:121:M64:C:6900:911:912:0:101:53208:0:0:0
+TV Polonia:434:M64:C:6900:641:642:643:101:53204:0:0:0
+:DIGIKABEL TR
 Show TV:402:M64:C:6900:1111:1112:0:101:53501:0:0:0
 TGRT:402:M64:C:6900:1121:1122:0:101:53502:0:0:0
-Kanal D:434:M64:C:6900:651:652:653:101:53205:0:0:0
-Fox Kids - RUS:434:M64:C:6900:671:672:0:101:53207:0:0:0
 Kanal 7:402:M64:C:6900:1131:1132:0:101:53504:0:0:0
-ERT-Sat:434:M64:C:6900:691:692:693:101:53209:0:0:0
-PCNE:121:M64:C:6900:911:912:0:101:53208:0:0:0
+ATV 2:434:M64:C:6900:631:632:633:101:53203:0:0:0
+Kanal D:434:M64:C:6900:651:652:653:101:53205:0:0:0
+Fox Kids:434:M64:C:6900:671:673:0:101:53210:0:0:0
+:DIGIKABEL I
 Rai 1:402:M64:C:6900:1141:1142:1143:101:53505:0:0:0
 Rai 2:402:M64:C:6900:1151:1152:1153:101:53506:0:0:0
 Rai 3:402:M64:C:6900:1161:1162:1163:101:53507:0:0:0
-Alice:121:M64:C:6900:961:962:0:101:53601:0:0:0
-Leonardo:121:M64:C:6900:951:952:0:101:53523:0:0:0
-Nuvolari:121:M64:C:6900:941:942:0:101:53211:0:0:0
-TV Polonia:434:M64:C:6900:641:642:643:101:53204:0:0:0
-TVEi:434:M64:C:6900:681:682:683:101:53508:0:0:0
-Canal 24 Horas:434:M64:C:6900:601:602:603:101:53509:0:0:0
-RTP Internacional:434:M64:C:6900:661:662:663:101:53206:0:0:0
+:DIGIKABEL RUS
 RTVi:434:M64:C:6900:611:612:0:101:53201:0:0:0
 Nashe Kino:434:M64:C:6900:621:622:0:101:53202:0:0:0
-Detski Mir:121:M64:C:6900:931:932:0:101:53503:0:0:0
-Fox Kids:434:M64:C:6900:671:673:0:101:53210:0:0:0
+Fox Kids:434:M64:C:6900:671:672:0:101:53207:0:0:0
+Detsky Mir:121:M64:C:6900:931:932:0:101:53503:0:0:0
 RTR Planeta:121:M64:C:6900:921:922:0:101:53212:0:0:0
+:DIGIKABEL ESP
+RTP Internacional:434:M64:C:6900:661:662:663:101:53206:0:0:0
+TVEi:434:M64:C:6900:681:682:683:101:53508:0:0:0
+Canal 24 Horas:434:M64:C:6900:601:602:603:101:53509:0:0:0
 :Radio-Sender (FTV)
 B5 aktuell:410:M64:C:6900:0:3101:0:0:28121:0:0:0
 Bayern 1:410:M64:C:6900:0:3601:0:0:28126:0:0:0
@@ -122,7 +128,7 @@
 DLR-Berlin:394:M64:C:6900:0:710:0:0:28012:0:0:0
 Fritz:426:M64:C:6900:0:901:0:0:28209:0:0:0
 hr2:410:M64:C:6900:0:3301:0:0:28123:0:0:0
-hr-chronos:410:M64:C:6900:0:3201:0:0:28122:0:0:0
+hr-skyline:410:M64:C:6900:0:3201:0:0:28122:0:0:0
 hr-klassik:410:M64:C:6900:0:3401:0:0:28124:0:0:0
 HR XXL:410:M64:C:6900:0:3501:0:0:28125:0:0:0
 JUMP:426:M64:C:6900:0:1001:0:0:28210:0:0:0
diff -ruNbw vdr-1.2.2/channels.conf.terr vdr-1.2.5/channels.conf.terr
--- vdr-1.2.2/channels.conf.terr	Sun May 11 14:00:48 2003
+++ vdr-1.2.5/channels.conf.terr	Sat Aug 30 12:31:55 2003
@@ -45,7 +45,14 @@
 KISS (RADIO):537833:I0C34D0M16B8T2G32Y0:T:27500:0:1101:0:0:26176:0:0:0
 oneword (RADIO):537833:I0C34D0M16B8T2G32Y0:T:27500:0:1501:0:0:26432:0:0:0
 Smash Hits! (RADIO):537833:I0C34D0M16B8T2G32Y0:T:27500:0:1201:0:0:26240:0:0:0
-: DVB-T Berlin Germany
+: DVB-T Berlin, Germany
+BBC World:177500:I0C23D0M16B8T8G8Y0:T:27500:49:50:55:0:16387:0:0:0
+FAB:177500:I0C23D0M16B8T8G8Y0:T:27500:3073:3074:3079:0:16576:0:0:0
+WDR:177500:I0C23D0M16B8T8G8Y0:T:27500:241:242:247:0:15:0:0:0
+SWR BW:177500:I0C23D0M16B8T8G8Y0:T:27500:257:258:263:0:16:0:0:0
+MDR Fernsehen:191500:I0C23D0M16B8T8G8Y0:T:27500:101:102:104:0:1:0:0:0
+arte:191500:I0C23D0M16B8T8G8Y0:T:27500:201:202,203:204:0:2:0:0:0
+NDR Fernsehen:191500:I0C23D0M16B8T8G8Y0:T:27500:301:302:304:0:3:0:0:0
 RTL:506000:I0C23D0M16B8T8G8Y0:T:27500:337:338:343:0:16405:0:0:0
 RTL2:506000:I0C23D0M16B8T8G8Y0:T:27500:353:354:359:0:16406:0:0:0
 Super RTL:506000:I0C23D0M16B8T8G8Y0:T:27500:433:434:439:0:16411:0:0:0
@@ -61,6 +68,15 @@
 N24:658000:I0C23D0M16B8T8G8Y0:T:27500:225:226:231:0:16398:0:0:0
 ProSieben:658000:I0C23D0M16B8T8G8Y0:T:27500:305:306;307:311:0:16403:0:0:0
 SAT.1:658000:I0C23D0M16B8T8G8Y0:T:27500:385:386:391:0:16408:0:0:0
-MTV:778000:I0C23D0M16B8T8G8Y0:T:27500:193:194:199:0:16396:0:0:0
-n-tv:778000:I0C23D0M16B8T8G8Y0:T:27500:273:274:279:0:16401:0:0:0
-Eurosport:778000:I0C23D0M16B8T8G8Y0:T:27500:577:578:583:0:16420:0:0:0
+Testkanal 9live:754000:I0C23D0M16B8T8G8Y0:T:27500:273:274:279:0:16401:0:0:0
+Eurosport:754000:I0C23D0M16B8T8G8Y0:T:27500:577:578:583:0:16420:0:0:0
+DSF:754000:I0C23D0M16B8T8G8Y0:T:27500:129:130:135:0:16392:0:0:0
+VIVA Plus:754000:I0C23D0M16B8T8G8Y0:T:27500:529:530:535:0:16417:0:0:0
+Testkanal Pro7:778000:I0C23D0M16B8T8G8Y0:T:27500:305:306:311:0:16403:0:0:0
+: DVB-T Hannover, Germany
+ARD:554000:I0C12D0M16B8T8G32Y0:T:27500:512:650:513:0:28156:0:0:0
+ZDF:554000:I0C12D0M16B8T8G32Y0:T:27500:513:651:513:0:28160:0:0:0
+NDR:554000:I0C12D0M16B8T8G32Y0:T:27500:514:652:513:0:28162:0:0:0
+RTL:530500:I0C12D0M16B8T8G32Y0:T:27500:512:650:513:0:1:0:0:0
+SAT1:530500:I0C12D0M16B8T8G32Y0:T:27500:513:651:513:0:2:0:0:0
+9Live:530500:I0C12D0M16B8T8G32Y0:T:27500:514:652:513:0:3:0:0:0
diff -ruNbw vdr-1.2.2/channels.h vdr-1.2.5/channels.h
--- vdr-1.2.2/channels.h	Sat Apr 26 11:15:40 2003
+++ vdr-1.2.5/channels.h	Sat Aug 16 11:12:15 2003
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: channels.h 1.7 2003/04/26 09:15:40 kls Exp $
+ * $Id: channels.h 1.8 2003/08/16 09:12:15 kls Exp $
  */
 
 #ifndef __CHANNELS_H
@@ -130,7 +130,7 @@
   int maxNumber;
 public:
   cChannels(void) { maxNumber = 0; }
-  virtual bool Load(const char *FileName, bool AllowComments = false);
+  virtual bool Load(const char *FileName, bool AllowComments = false, bool MustExist = false);
   int GetNextGroup(int Idx);   // Get next channel group
   int GetPrevGroup(int Idx);   // Get previous channel group
   int GetNextNormal(int Idx);  // Get next normal channel (not group)
diff -ruNbw vdr-1.2.2/config.c vdr-1.2.5/config.c
--- vdr-1.2.2/config.c	Sun May 11 15:50:02 2003
+++ vdr-1.2.5/config.c	Sun Aug 24 13:00:24 2003
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: config.c 1.114 2003/05/11 13:50:02 kls Exp $
+ * $Id: config.c 1.116 2003/08/24 11:00:24 kls Exp $
  */
 
 #include "config.h"
@@ -215,7 +215,7 @@
      *p = 0;
      char *Name  = compactspace(s);
      char *Value = compactspace(p + 1);
-     if (*Name && *Value) {
+     if (*Name) { // value may be an empty string
         p = strchr(Name, '.');
         if (p) {
            *p = 0;
@@ -262,6 +262,7 @@
   EPGScanTimeout = 5;
   EPGBugfixLevel = 2;
   SVDRPTimeout = 300;
+  ZapTimeout = 3;
   SortTimers = 1;
   PrimaryLimit = 0;
   DefaultPriority = 50;
@@ -413,6 +414,7 @@
   else if (!strcasecmp(Name, "EPGScanTimeout"))      EPGScanTimeout     = atoi(Value);
   else if (!strcasecmp(Name, "EPGBugfixLevel"))      EPGBugfixLevel     = atoi(Value);
   else if (!strcasecmp(Name, "SVDRPTimeout"))        SVDRPTimeout       = atoi(Value);
+  else if (!strcasecmp(Name, "ZapTimeout"))          ZapTimeout         = atoi(Value);
   else if (!strcasecmp(Name, "SortTimers"))          SortTimers         = atoi(Value);
   else if (!strcasecmp(Name, "PrimaryLimit"))        PrimaryLimit       = atoi(Value);
   else if (!strcasecmp(Name, "DefaultPriority"))     DefaultPriority    = atoi(Value);
@@ -462,6 +464,7 @@
   Store("EPGScanTimeout",     EPGScanTimeout);
   Store("EPGBugfixLevel",     EPGBugfixLevel);
   Store("SVDRPTimeout",       SVDRPTimeout);
+  Store("ZapTimeout",         ZapTimeout);
   Store("SortTimers",         SortTimers);
   Store("PrimaryLimit",       PrimaryLimit);
   Store("DefaultPriority",    DefaultPriority);
diff -ruNbw vdr-1.2.2/config.h vdr-1.2.5/config.h
--- vdr-1.2.2/config.h	Thu Jun 12 22:37:14 2003
+++ vdr-1.2.5/config.h	Wed Sep 17 18:08:56 2003
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: config.h 1.165 2003/06/12 20:37:14 kls Exp $
+ * $Id: config.h 1.174 2003/09/17 16:08:56 kls Exp $
  */
 
 #ifndef __CONFIG_H
@@ -19,8 +19,8 @@
 #include "device.h"
 #include "tools.h"
 
-#define VDRVERSION  "1.2.2"
-#define VDRVERSNUM   10202  // Version * 10000 + Major * 100 + Minor
+#define VDRVERSION  "1.2.5"
+#define VDRVERSNUM   10205  // Version * 10000 + Major * 100 + Minor
 
 #define MAXPRIORITY 99
 #define MAXLIFETIME 99
@@ -87,7 +87,7 @@
   cConfig(void) { fileName = NULL; }
   virtual ~cConfig() { free(fileName); }
   const char *FileName(void) { return fileName; }
-  bool Load(const char *FileName = NULL, bool AllowComments = false)
+  bool Load(const char *FileName = NULL, bool AllowComments = false, bool MustExist = false)
   {
     Clear();
     if (FileName) {
@@ -95,7 +95,7 @@
        fileName = strdup(FileName);
        allowComments = AllowComments;
        }
-    bool result = false;
+    bool result = !MustExist;
     if (fileName && access(fileName, F_OK) == 0) {
        isyslog("loading %s", fileName);
        FILE *f = fopen(fileName, "r");
@@ -125,9 +125,13 @@
                 }
           fclose(f);
           }
-       else
+       else {
           LOG_ERROR_STR(fileName);
+          result = false;
+          }
        }
+    if (!result)
+       fprintf(stderr, "vdr: error while reading '%s'\n", fileName);
     return result;
   }
   bool Save(void)
@@ -215,6 +219,7 @@
   int EPGScanTimeout;
   int EPGBugfixLevel;
   int SVDRPTimeout;
+  int ZapTimeout;
   int SortTimers;
   int PrimaryLimit;
   int DefaultPriority, DefaultLifetime;
diff -ruNbw vdr-1.2.2/cutter.c vdr-1.2.5/cutter.c
--- vdr-1.2.2/cutter.c	Sat May 24 13:59:33 2003
+++ vdr-1.2.5/cutter.c	Sun Aug 17 11:04:04 2003
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: cutter.c 1.4 2003/05/24 11:59:33 kls Exp $
+ * $Id: cutter.c 1.5 2003/08/17 09:04:04 kls Exp $
  */
 
 #include "cutter.h"
@@ -86,7 +86,7 @@
 
            // Make sure there is enough disk space:
 
-           AssertFreeDiskSpace();
+           AssertFreeDiskSpace(-1);
 
            // Read one frame:
 
diff -ruNbw vdr-1.2.2/device.c vdr-1.2.5/device.c
--- vdr-1.2.2/device.c	Sat Aug  2 13:44:28 2003
+++ vdr-1.2.5/device.c	Fri Aug 15 14:34:36 2003
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: device.c 1.46 2003/08/02 11:44:28 kls Exp $
+ * $Id: device.c 1.47 2003/08/15 12:34:36 kls Exp $
  */
 
 #include "device.h"
@@ -214,6 +214,11 @@
 
 void cDevice::SetVideoFormat(bool VideoFormat16_9)
 {
+}
+
+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); }
diff -ruNbw vdr-1.2.2/device.h vdr-1.2.5/device.h
--- vdr-1.2.2/device.h	Sun May 11 10:50:04 2003
+++ vdr-1.2.5/device.h	Fri Aug 15 15:05:50 2003
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: device.h 1.33 2003/05/11 08:50:04 kls Exp $
+ * $Id: device.h 1.34 2003/08/15 13:05:50 kls Exp $
  */
 
 #ifndef __DEVICE_H
@@ -45,6 +45,10 @@
                  // KNOWN TO YOUR PLAYER.
                };
 
+enum eVideoSystem { vsPAL,
+                    vsNTSC
+                  };
+
 class cOsdBase;
 class cChannel;
 class cPlayer;
@@ -248,6 +252,9 @@
   virtual void SetVideoFormat(bool VideoFormat16_9);
          ///< Sets the output video format to either 16:9 or 4:3 (only useful
          ///< if this device has an MPEG decoder).
+  virtual eVideoSystem GetVideoSystem(void);
+         ///< Returns the video system of the currently displayed material
+         ///< (default is PAL).
 
 // Audio facilities
 
diff -ruNbw vdr-1.2.2/dvbdevice.c vdr-1.2.5/dvbdevice.c
--- vdr-1.2.2/dvbdevice.c	Sat May 24 15:23:51 2003
+++ vdr-1.2.5/dvbdevice.c	Sat Sep  6 15:19:33 2003
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: dvbdevice.c 1.60 2003/05/24 13:23:51 kls Exp $
+ * $Id: dvbdevice.c 1.64 2003/09/06 13:19:33 kls Exp $
  */
 
 #include "dvbdevice.h"
@@ -74,6 +74,7 @@
   cChannel channel;
   const char *diseqcCommands;
   bool active;
+  bool useCa;
   time_t startTime;
   eTunerStatus tunerStatus;
   cMutex mutex;
@@ -84,7 +85,7 @@
   cDvbTuner(int Fd_Frontend, int CardIndex, fe_type_t FrontendType, cCiHandler *CiHandler);
   virtual ~cDvbTuner();
   bool IsTunedTo(const cChannel *Channel) const;
-  void Set(const cChannel *Channel, bool Tune);
+  void Set(const cChannel *Channel, bool Tune, bool UseCa);
   bool Locked(void) { return tunerStatus == tsLocked; }
   };
 
@@ -96,6 +97,7 @@
   ciHandler = CiHandler;
   diseqcCommands = NULL;
   active = false;
+  useCa = false;
   tunerStatus = tsIdle;
   startTime = time(NULL);
   Start();
@@ -114,7 +116,7 @@
   return tunerStatus != tsIdle && channel.Source() == Channel->Source() && channel.Frequency() == Channel->Frequency();
 }
 
-void cDvbTuner::Set(const cChannel *Channel, bool Tune)
+void cDvbTuner::Set(const cChannel *Channel, bool Tune, bool UseCa)
 {
   cMutexLock MutexLock(&mutex);
   bool CaChange = !(Channel->GetChannelID() == channel.GetChannelID());
@@ -122,6 +124,7 @@
      tunerStatus = tsSet;
   else if (tunerStatus == tsCam && CaChange)
      tunerStatus = tsTuned;
+  useCa = UseCa;
   if (Channel->Ca() && CaChange)
      startTime = time(NULL);
   channel = *Channel;
@@ -267,7 +270,7 @@
               }
            if (tunerStatus >= tsLocked) {
               if (ciHandler) {
-                 if (ciHandler->Process()) {
+                 if (ciHandler->Process() && useCa) {
                     if (tunerStatus != tsCam) {//XXX TODO update in case the CA descriptors have changed
                        for (int Slot = 0; Slot < ciHandler->NumSlots(); Slot++) {
                            uchar buffer[2048];
@@ -525,6 +528,19 @@
      CHECK(ioctl(fd_video, VIDEO_SET_FORMAT, VideoFormat16_9 ? VIDEO_FORMAT_16_9 : VIDEO_FORMAT_4_3));
 }
 
+eVideoSystem cDvbDevice::GetVideoSystem(void)
+{
+  eVideoSystem VideoSytem = vsPAL;
+  video_size_t vs;
+  if (ioctl(fd_video, VIDEO_GET_SIZE, &vs) == 0) {
+     if (vs.h == 480 || vs.h == 240)
+        VideoSytem = vsNTSC;
+     }
+  else
+     LOG_ERROR;
+  return VideoSytem;
+}
+
 //                            ptAudio        ptVideo        ptPcr        ptTeletext        ptDolby        ptOther
 dmx_pes_type_t PesTypes[] = { DMX_PES_AUDIO, DMX_PES_VIDEO, DMX_PES_PCR, DMX_PES_TELETEXT, DMX_PES_OTHER, DMX_PES_OTHER };
 
@@ -600,13 +616,12 @@
 {
   bool result = false;
   bool hasPriority = Priority < 0 || Priority > this->Priority();
-  bool needsDetachReceivers = true;
+  bool needsDetachReceivers = false;
 
   if (ProvidesSource(Channel->Source()) && ProvidesCa(Channel->Ca())) {
      result = hasPriority;
      if (Receiving()) {
         if (dvbTuner->IsTunedTo(Channel)) {
-           needsDetachReceivers = false;
            if (!HasPid(Channel->Vpid())) {
 #ifdef DO_MULTIPLE_RECORDINGS
               if (Channel->Ca() > CACONFBASE)
@@ -623,6 +638,8 @@
            else
               result = !IsPrimaryDevice() || Priority >= Setup.PrimaryLimit;
            }
+        else
+           needsDetachReceivers = true;
         }
      }
   if (NeedsDetachReceivers)
@@ -659,6 +676,7 @@
   StartTransferMode = false;
 #endif
 
+  // XXX 1.3: use the same mechanism as below (!EITScanner.UsesDevice(this))
   if (EITScanner.Active()) {
      StartTransferMode = false;
      TurnOnLivePIDs = false;
@@ -676,7 +694,7 @@
   if (TurnOffLivePIDs)
      TurnOffLiveMode();
 
-  dvbTuner->Set(Channel, DoTune);
+  dvbTuner->Set(Channel, DoTune, !EITScanner.UsesDevice(this)); //XXX 1.3: this is an ugly hack - find a cleaner solution
 
   // PID settings:
 
@@ -882,11 +900,49 @@
    If anybody ever finds out what could be changed so that VIDEO_STILLPICTURE
    could be used, please let me know!
    kls 2002-03-23
+   2003-08-30: apparently the driver can't handle PES data, so Oliver Endriss
+               <o.endriss@gmx.de> has changed this to strip all PES headers
+               and send pure ES data to the driver. Seems to work just fine!
+               Let's drop the VIDEO_STILLPICTURE_WORKS_WITH_VDR_FRAMES stuff
+               once this has proven to work in all cases.
 */
-//#define VIDEO_STILLPICTURE_WORKS_WITH_VDR_FRAMES
+#define VIDEO_STILLPICTURE_WORKS_WITH_VDR_FRAMES
 #ifdef VIDEO_STILLPICTURE_WORKS_WITH_VDR_FRAMES
+  if (Data[0] == 0x00 && Data[1] == 0x00 && Data[2] == 0x01 && (Data[3] & 0xF0) == 0xE0) {
+     // PES data
+     char *buf = MALLOC(char, Length);
+     if (!buf)
+        return;
+     int i = 0;
+     int blen = 0;
+     while (i < Length - 4) {
+           if (Data[i] == 0x00 && Data[i + 1] == 0x00 && Data[i + 2] == 0x01 && (Data[i + 3] & 0xF0) == 0xE0) {
+              // skip PES header
+              int offs = i + 6;
+              int len = Data[i + 4] * 256 + Data[i + 5];
+              // skip header extension
+              if ((Data[i + 6] & 0xC0) == 0x80) {
+                 offs += 3;
+                 offs += Data[i + 8];
+                 len -= 3;
+                 len -= Data[i + 8];
+                 }
+              memcpy(&buf[blen], &Data[offs], len);
+              i = offs + len;
+              blen += len;
+              }
+           else
+              i++;
+           }
+     video_still_picture sp = { buf, blen };
+     CHECK(ioctl(fd_video, VIDEO_STILLPICTURE, &sp));
+     free(buf);
+     }
+  else {
+     // non-PES data
   video_still_picture sp = { (char *)Data, Length };
   CHECK(ioctl(fd_video, VIDEO_STILLPICTURE, &sp));
+     }
 #else
 #define MIN_IFRAME 400000
   for (int i = MIN_IFRAME / Length + 1; i > 0; i--) {
diff -ruNbw vdr-1.2.2/dvbdevice.h vdr-1.2.5/dvbdevice.h
--- vdr-1.2.2/dvbdevice.h	Fri May  2 14:21:51 2003
+++ vdr-1.2.5/dvbdevice.h	Fri Aug 15 14:34:55 2003
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: dvbdevice.h 1.21 2003/05/02 12:21:51 kls Exp $
+ * $Id: dvbdevice.h 1.22 2003/08/15 12:34:55 kls Exp $
  */
 
 #ifndef __DVBDEVICE_H
@@ -80,6 +80,7 @@
 
 public:
   virtual void SetVideoFormat(bool VideoFormat16_9);
+  virtual eVideoSystem GetVideoSystem(void);
 
 // Audio facilities
 
diff -ruNbw vdr-1.2.2/dvbspu.c vdr-1.2.5/dvbspu.c
--- vdr-1.2.2/dvbspu.c	Sat Oct 26 12:46:49 2002
+++ vdr-1.2.5/dvbspu.c	Fri Aug 15 15:04:39 2003
@@ -8,7 +8,7 @@
  *
  * parts of this file are derived from the OMS program.
  *
- * $Id: dvbspu.c 1.3 2002/10/26 10:46:49 kls Exp $
+ * $Id: dvbspu.c 1.4 2003/08/15 13:04:39 kls Exp $
  */
 
 #include <assert.h>
@@ -301,8 +301,10 @@
 
 int cDvbSpuDecoder::ScaleYcoord(int value)
 {
-    if (scaleMode == eSpuLetterBox)
-        return lround((value * 3.0) / 4.0 + 72.0);
+    if (scaleMode == eSpuLetterBox) {
+        int offset = cDevice::PrimaryDevice()->GetVideoSystem() == vsPAL ? 72 : 60;
+        return lround((value * 3.0) / 4.0) + offset;
+        }
     else
         return value;
 }
diff -ruNbw vdr-1.2.2/eitscan.c vdr-1.2.5/eitscan.c
--- vdr-1.2.2/eitscan.c	Sat May 24 15:34:59 2003
+++ vdr-1.2.5/eitscan.c	Sat Sep  6 15:06:13 2003
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: eitscan.c 1.13 2003/05/24 13:34:59 kls Exp $
+ * $Id: eitscan.c 1.14 2003/09/06 13:06:13 kls Exp $
  */
 
 #include "eitscan.h"
@@ -17,6 +17,7 @@
 cEITScanner::cEITScanner(void)
 {
   lastScan = lastActivity = time(NULL);
+  currentDevice = NULL;
   currentChannel = 0;
   memset(lastChannel, 0, sizeof(lastChannel));
   numTransponders = 0;
@@ -66,7 +67,9 @@
                                if (Device == cDevice::PrimaryDevice() && !currentChannel) {
                                   currentChannel = Device->CurrentChannel();
                                   }
+                               currentDevice = Device;
                                Device->SwitchChannel(Channel, false);
+                               currentDevice = NULL;
                                break;
                                }
                             }
diff -ruNbw vdr-1.2.2/eitscan.h vdr-1.2.5/eitscan.h
--- vdr-1.2.2/eitscan.h	Sat May 24 15:21:36 2003
+++ vdr-1.2.5/eitscan.h	Sat Sep  6 15:05:51 2003
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: eitscan.h 1.3 2003/05/24 13:21:36 kls Exp $
+ * $Id: eitscan.h 1.4 2003/09/06 13:05:51 kls Exp $
  */
 
 #ifndef __EITSCAN_H
@@ -19,6 +19,7 @@
          ScanTimeout = 20
        };
   time_t lastScan, lastActivity;
+  cDevice *currentDevice;
   int currentChannel;
   int lastChannel[MAXDEVICES];
   int numTransponders, *transponders;
@@ -27,6 +28,7 @@
   cEITScanner(void);
   ~cEITScanner();
   bool Active(void) { return currentChannel; }
+  bool UsesDevice(const cDevice *Device) { return currentDevice == Device; }
   void Activity(void);
   void Process(void);
   };
diff -ruNbw vdr-1.2.2/i18n.c vdr-1.2.5/i18n.c
--- vdr-1.2.2/i18n.c	Sun Jul 13 17:03:07 2003
+++ vdr-1.2.5/i18n.c	Thu Sep 11 15:51:56 2003
@@ -4,13 +4,13 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: i18n.c 1.129 2003/07/13 15:03:07 kls Exp $
+ * $Id: i18n.c 1.134 2003/09/11 13:51:56 kls Exp $
  *
  * Translations provided by:
  *
  * Slovenian   Miha Setina <mihasetina@softhome.net> and Matjaz Thaler <matjaz.thaler@guest.arnes.si>
  * Italian     Alberto Carraro <bertocar@tin.it> and Antonio Ospite <ospite@studenti.unina.it>
- * Dutch       Arnold Niessen <niessen@iae.nl> <arnold.niessen@philips.com>
+ * Dutch       Arnold Niessen <niessen@iae.nl> <arnold.niessen@philips.com> and Hans Dingemans <hans.dingemans@tacticalops.nl>
  * Portuguese  Paulo Lopes <pmml@netvita.pt>
  * French      Jean-Claude Repetto <jc@repetto.org>, Olivier Jacques <jacquesolivier@hotmail.com> and Gregoire Favre <greg@magma.unil.ch>
  * Norwegian   Jørgen Tvedt <pjtvedt@online.no> and Truls Slevigen <truls@slevigen.no>
@@ -79,7 +79,7 @@
     "Português",
     "Français",
     "Norsk",
-    "suomi",
+    "suomi", // this is not a typo - it's really lowercase!
     "Polski",
     "Español",
     "Ellinika",
@@ -212,7 +212,7 @@
     "Befehle für Aufzeichnungen",
     "Ukazi za snemanje",
     "Comandi di Registrazione",
-    "",// TODO
+    "Opname commando's",
     "",// TODO
     "Commandes d'enregistrement",
     "",// TODO
@@ -672,7 +672,7 @@
     "Einfügen",
     "Vstavi",
     "Inserisci",
-    "",// TODO
+    "Invoegen",
     "",// TODO
     "Insért",
     "",// TODO
@@ -689,7 +689,7 @@
     "Überschreiben",
     "Prepisi",
     "Sovrascrivi",
-    "",// TODO
+    "Overschrijven",
     "",// TODO
     "Écraser",
     "",// TODO
@@ -723,7 +723,7 @@
     "Reset",
     "Reset",
     "Reset",
-    "",//TODO
+    "Herstart",
     "",//TODO
     "Réinitialisation",
     "",//TODO
@@ -997,7 +997,7 @@
     "Quelle",
     "Pozicija",
     "Sorgente",
-    "",//TODO
+    "Bron",
     "",//TODO
     "Source",
     "",//TODO
@@ -1594,7 +1594,7 @@
     "Kanal nicht verfügbar!",
     "Kanal ni razpolozljiv!",
     "Canale non disponibile!",
-    "",//TODO
+    "Kanaal niet beschikbaar",
     "",//TODO
     "Chaîne non disponible!",
     "",//TODO
@@ -1611,7 +1611,7 @@
     "Kanaleinstellungen sind nicht eindeutig!",
     "Nastavitve kanala niso edinstvene!",
     "Paramentri Canale non unici!",
-    "",//TODO
+    "Kanaalinstellingen zijn niet uniek!",
     "",//TODO
     "Caractéristiques des chaînes ne sont pas uniques",
     "",//TODO
@@ -1662,7 +1662,7 @@
     "Keine Schnittmarken gesetzt!",
     "Nobena tocka ni definirana!",
     "Nessun marcatore di modifica definito!",
-    "",//TODO
+    "Geen bewerkingsmarkeringen gedefinieerd!",
     "",//TODO
     "Pas de marques d'édition définies!",
     "",//TODO
@@ -1747,7 +1747,7 @@
     "CAM-Menü kann nicht geöffnet werden!",
     "Ne morem odpreti CAM menija!",
     "Impossibile aprire il menu CAM!",
-    "",//TODO
+    "Kan CAM-menu niet openen!",
     "",//TODO
     "Impossible d'ouvrir le menu CAM!",
     "",//TODO
@@ -1764,7 +1764,7 @@
     "CAM-Reset fehlgeschlagen!",
     "Ne morem resetirati CAM-a",
     "Impossibile reimpostare il modulo CAM!",
-    "",//TODO
+    "Kan CAM niet herstarten!",
     "",//TODO
     "Impossible de réinitialiser la CAM!",
     "",//TODO
@@ -1781,7 +1781,7 @@
     "CAM wurde zurückgesetzt!",
     "CAM je resetiran!",
     "Modulo CAM reimpostato!",
-    "",//TODO
+    "CAM is herstart!",
     "",//TODO
     "La CAM a été réinitialisée",
     "",//TODO
@@ -2412,7 +2412,7 @@
     "Pause Priorität",
     "Prioriteta pavze",
     "Priorita' di pausa",
-    "",// TODO
+    "Pauze prioriteit",
     "",// TODO
     "Priorité des pauses",
     "",// TODO
@@ -2429,7 +2429,7 @@
     "Pause Lebensdauer (d)",
     "Cas pavze (d)",
     "Durata pausa (gg)",
-    "",// TODO
+    "Pauze levensduur (d)",
     "",// TODO
     "Durée de vie des pauses (j)",
     "",// TODO
@@ -2497,7 +2497,7 @@
     "Dauer der Direktaufzeichnung (min)",
     "Cas direktnega snemanja (min)",
     "Tempo registrazione istantanea (min)",
-    "",//TODO
+    "Duur van de directe opname (min)",
     "",//TODO
     "Durée enregistr. immédiat (min)",
     "",//TODO
@@ -2599,7 +2599,7 @@
     "Wiedergabe ID",
     "Predvajalni ID",
     "Resume ID",// TODO
-    "Resume ID",// TODO
+    "Hervattings ID",
     "Resume ID",// TODO
     "ID de reprise",
     "Resume ID",// TODO
@@ -2663,6 +2663,23 @@
     "SVDRP Timeout (s)",
     "SVDRP Timeout (s)",
   },
+  { "Setup.Miscellaneous$Zap timeout (s)",
+    "Zap Timeout (s)",
+    "",// TODO
+    "",// TODO
+    "Zap timeout (s)",
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "Kanavavalinnan odotusaika (s)",
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "",// TODO
+    "",// TODO
+  },
   // The days of the week:
   { "MTWTFSS",
     "MDMDFSS",
@@ -2707,11 +2724,11 @@
     "",// TODO
     " aàbcçdeéèêfghiîjklmnoôpqrstuùûvwxyz0123456789-.#~",
     "",// TODO
-    " abcdefghijklmnopqrstuvxyzåäö0123456789-.#~",
+    " abcdefghijklmnopqrstuvwxyzåäö0123456789-.#~",
     " abcdefghijklmnopqrstuvwxyz0123456789-.#~",
     " aábcdeéfghiíjklmnñoópqrstuúvwxyz0123456789-.#~",
     "",// TODO
-    " abcdefghijklmnopqrstuvxyzåäö0123456789-.#~",
+    " abcdefghijklmnopqrstuvwxyzåäö0123456789-.#~",
     " abcdefghijklmnopqrstuvwxyz0123456789-.#~",
     " aábcdeéfghiíjklmnoóöpqrstuúüvwxyz0123456789-.,#~",
     " aàbcçdeéèfghiíjklmnoòpqrstuúvwxyz0123456789-.,#~_·",
@@ -2908,7 +2925,7 @@
     "('Menü' drücken zum Überspringen)",
     "pritisnite 'Meni' za preskok te tipke",
     "(premere 'Menu' per saltare questo tasto)",
-    "",// TODO
+    "Druk 'Menu' om deze toets over te slaan",
     "",// TODO
     "('Menu' pour passer cette touche)",
     "",// TODO
@@ -3147,7 +3164,7 @@
     "Wiedergabe",
     "Predvajaj",
     "Riproduci",
-    "",// TODO
+    "Weergeven",
     "",// TODO
     "Lecture",
     "",// TODO
@@ -3164,7 +3181,7 @@
     "Pause",
     "Pavza",
     "Pausa",
-    "",// TODO
+    "Pauze",
     "",// TODO
     "Pause",
     "",// TODO
@@ -3181,7 +3198,7 @@
     "Stop",
     "Ustavi",
     "Stop",
-    "",// TODO
+    "Stop",
     "Stop",
     "Stop",
     "",// TODO
@@ -3198,7 +3215,7 @@
     "Aufnehmen",
     "Snemaj",
     "Registra",
-    "",// TODO
+    "Opnemen",
     "",// TODO
     "Enregistrement",
     "",// TODO
@@ -3215,7 +3232,7 @@
     "Vorlauf",
     "Hitro naprej",
     "Avanti Veloce",
-    "",// TODO
+    "Vooruitspoelen",
     "",// TODO
     "Avance rapide",
     "",// TODO
@@ -3232,7 +3249,7 @@
     "Rücklauf",
     "Hitro nazaj",
     "Indietro Veloce",
-    "",// TODO
+    "Terugspoelen",
     "",// TODO
     "Retour rapide",
     "",// TODO
@@ -3266,7 +3283,7 @@
     "Kanal+",
     "Kanal+",
     "Canale +",
-    "",// TODO
+    "Kanaal+",
     "",// TODO
     "Chaîne+",
     "",// TODO
@@ -3283,7 +3300,7 @@
     "Kanal-",
     "Kanal-",
     "Canale -",
-    "",// TODO
+    "Kanaal-",
     "",// TODO
     "Chaîne-",
     "",// TODO
@@ -3386,7 +3403,7 @@
     "aus",
     "izklop",
     "off",
-    "",// TODO
+    "uit",
     "off",
     "",// TODO
     "",// TODO
@@ -3403,7 +3420,7 @@
     "keine",
     "nobeden",
     "nessuno",
-    "",// TODO
+    "geen",
     "",// TODO
     "aucun",
     "",// TODO
@@ -3420,7 +3437,7 @@
     "auto",
     "avtomatsko",
     "auto",
-    "",// TODO
+    "auto",
     "",// TODO
     "auto",
     "",// TODO
@@ -3692,7 +3709,7 @@
     "Live-Signal wird angehalten...",
     "Ustavljanje predvajanja v zivo...",
     "Pausa del canale in visione...",
-    "",// TODO
+    "Pauzeren live uitzending...",
     "",// TODO
     "Pause de l'émission en direct...",
     "",// TODO
@@ -3709,7 +3726,7 @@
     "Dieses Plugin hat keine Setup-Parameter!",
     "Ta plugin nima nastavitvenih parametrov!",
     "Questo plugin non ha parametri di setup!",
-    "",// TODO
+    "Deze plugin heeft geen instelparameters",
     "",// TODO
     "Ce plugin n'a pas de paramètres!",
     "",// TODO
diff -ruNbw vdr-1.2.2/keys.c vdr-1.2.5/keys.c
--- vdr-1.2.2/keys.c	Sat Nov 30 17:01:37 2002
+++ vdr-1.2.5/keys.c	Sun Sep 14 12:07:47 2003
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: keys.c 1.4 2002/11/30 16:01:37 kls Exp $
+ * $Id: keys.c 1.5 2003/09/14 10:07:47 kls Exp $
  */
 
 #include "keys.h"
@@ -212,7 +212,8 @@
                  plugin = strdup(p + 1);
                  if (!cPluginManager::GetPlugin(plugin)) {
                     esyslog("ERROR: unknown plugin '%s'", plugin);
-                    return false;
+                    // this is not a fatal error - plugins may or may not be loaded
+                    macro[--n] = kNone; // makes sure the key doesn't cause any side effects
                     }
                  }
               else {
diff -ruNbw vdr-1.2.2/libdtv/libsi/include/libsi.h vdr-1.2.5/libdtv/libsi/include/libsi.h
--- vdr-1.2.2/libdtv/libsi/include/libsi.h	Sun May 11 17:08:30 2003
+++ vdr-1.2.5/libdtv/libsi/include/libsi.h	Fri Aug 15 15:54:53 2003
@@ -1226,7 +1226,6 @@
 void siParseDescriptor (struct LIST *, u_char *);
 char *siGetDescriptorText (u_char *, int);
 char *siGetDescriptorName (u_char *, int);
-u_long crc32 (char *data, int len);
 
 /* si_debug_services.c */
 
diff -ruNbw vdr-1.2.2/libdtv/libsi/si_parser.c vdr-1.2.5/libdtv/libsi/si_parser.c
--- vdr-1.2.2/libdtv/libsi/si_parser.c	Sun May 11 17:06:57 2003
+++ vdr-1.2.5/libdtv/libsi/si_parser.c	Fri Aug 15 15:56:02 2003
@@ -36,7 +36,7 @@
 #include "libsi.h"
 #include "si_tables.h"
 
-
+static u_long crc32 (char *data, int len);
 
 struct LIST *siParsePAT (u_char *Buffer) 
 {
@@ -1240,7 +1240,7 @@
          if (*Buffer == 0) break;
 
          if ((*Buffer >= ' ' && *Buffer <= '~') || (*Buffer == '\n') ||
-             (*Buffer >= 0xa0 && *Buffer <= 0xff)) *tmp++ = *Buffer;
+             (*Buffer >= 0xa0)) *tmp++ = *Buffer;
          if (*Buffer == 0x8A) *tmp++ = '\n';
          if ((*Buffer == 0x86 || *Buffer == 0x87) && !(GDT_NAME_DESCRIPTOR & type)) *tmp++ = ' ';
          Buffer++;
@@ -1323,7 +1323,7 @@
 	0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668,
 	0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4};
 
-u_long crc32 (char *data, int len)
+static u_long crc32 (char *data, int len)
 {
 	register int i;
 	u_long crc = 0xffffffff;
diff -ruNbw vdr-1.2.2/menu.c vdr-1.2.5/menu.c
--- vdr-1.2.2/menu.c	Sun Aug  3 11:38:37 2003
+++ vdr-1.2.5/menu.c	Sun Sep 14 12:49:28 2003
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: menu.c 1.264 2003/08/03 09:38:37 kls Exp $
+ * $Id: menu.c 1.272 2003/09/14 10:49:28 kls Exp $
  */
 
 #include "menu.h"
@@ -25,6 +25,7 @@
 #include "sources.h"
 #include "status.h"
 #include "timers.h"
+#include "transfer.h"
 #include "videodir.h"
 
 #define MENUTIMEOUT     120 // seconds
@@ -763,6 +764,8 @@
 
 void cMenuChannels::Move(int From, int To)
 {
+  int CurrentChannelNr = cDevice::CurrentChannel();
+  cChannel *CurrentChannel = Channels.GetByNumber(CurrentChannelNr);
   cChannel *FromChannel = GetChannel(From);
   cChannel *ToChannel = GetChannel(To);
   if (FromChannel && ToChannel) {
@@ -772,6 +775,8 @@
      cOsdMenu::Move(From, To);
      Propagate();
      isyslog("channel %d moved to %d", FromNumber, ToNumber);
+     if (CurrentChannel && CurrentChannel->Number() != CurrentChannelNr)
+        Channels.SwitchTo(CurrentChannel->Number());
      }
 }
 
@@ -1245,7 +1250,7 @@
 
   currentChannel = CurrentChannelNr;
   free(pArray);
-  SetHelp(tr("Record"), Now ? tr("Next") : tr("Now"), tr("Button$Schedule"), tr("Switch"));
+  SetHelp(Count() ? tr("Record") : NULL, Now ? tr("Next") : tr("Now"), tr("Button$Schedule"), tr("Switch"));
 }
 
 const cEventInfo *cMenuWhatsOn::ScheduleEventInfo(void)
@@ -1353,7 +1358,7 @@
      cMenuWhatsOn::SetCurrentChannel(channel->Number());
      schedules = cSIProcessor::Schedules(mutexLock);
      PrepareSchedule(channel);
-     SetHelp(tr("Record"), tr("Now"), tr("Next"));
+     SetHelp(Count() ? tr("Record") : NULL, tr("Now"), tr("Next"));
      }
 }
 
@@ -1465,7 +1470,7 @@
            PrepareSchedule(channel);
            if (channel->Number() != cDevice::CurrentChannel()) {
               otherChannel = channel->Number();
-              SetHelp(tr("Record"), tr("Now"), tr("Next"), tr("Switch"));
+              SetHelp(Count() ? tr("Record") : NULL, tr("Now"), tr("Next"), tr("Switch"));
               }
            Display();
            }
@@ -2252,6 +2257,7 @@
   Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Min. event timeout (min)"),   &data.MinEventTimeout));
   Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Min. user inactivity (min)"), &data.MinUserInactivity));
   Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$SVDRP timeout (s)"),          &data.SVDRPTimeout));
+  Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Zap timeout (s)"),            &data.ZapTimeout));
 }
 
 // --- cMenuSetupPluginItem --------------------------------------------------
@@ -2997,6 +3003,8 @@
      else {
         Timers.Del(timer);
         Timers.Save();
+        if (!cReplayControl::LastReplayed()) // an instant recording, maybe from cRecordControls::PauseLiveVideo()
+           cReplayControl::SetRecording(fileName, Recording.Name());
         }
      timer = NULL;
      return;
@@ -3093,8 +3101,11 @@
      int Priority = Timer ? Timer->Priority() : Pause ? Setup.PausePriority : Setup.DefaultPriority;
      cDevice *device = cDevice::GetDevice(channel, Priority, &NeedsDetachReceivers);
      if (device) {
-        if (NeedsDetachReceivers)
+        if (NeedsDetachReceivers) {
            Stop(device);
+           if (device == cTransferControl::ReceiverDevice())
+              cControl::Shutdown(); // in case this device was used for Transfer Mode
+           }
         if (!device->SwitchChannel(channel, false)) {
            cThread::EmergencyExit(true);
            return false;
@@ -3520,6 +3531,10 @@
      else {
         marks.Add(Current);
         ShowTimed(2);
+        bool Play, Forward;
+        int Speed;
+        if (GetReplayMode(Play, Forward, Speed) && !Play)
+           Goto(Current, true);
         }
      marks.Save();
      }
@@ -3648,9 +3663,10 @@
       DoShowMode = false;
       switch (Key) {
         // Editing:
-        //XXX should we do this only when the ProgressDisplay is on???
         case kMarkToggle:      MarkToggle(); break;
+        case kMarkJumpBack|k_Repeat:
         case kMarkJumpBack:    MarkJump(false); break;
+        case kMarkJumpForward|k_Repeat:
         case kMarkJumpForward: MarkJump(true); break;
         case kMarkMoveBack|k_Repeat:
         case kMarkMoveBack:    MarkMove(false); break;
diff -ruNbw vdr-1.2.2/osd.h vdr-1.2.5/osd.h
--- vdr-1.2.2/osd.h	Mon Apr 21 12:27:41 2003
+++ vdr-1.2.5/osd.h	Sun Sep 14 12:59:22 2003
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: osd.h 1.39 2003/04/21 10:27:41 kls Exp $
+ * $Id: osd.h 1.40 2003/09/14 10:59:22 kls Exp $
  */
 
 #ifndef __OSD_H
@@ -165,7 +165,7 @@
   int Current(void) { return current; }
   void Add(cOsdItem *Item, bool Current = false, cOsdItem *After = NULL);
   void Ins(cOsdItem *Item, bool Current = false, cOsdItem *Before = NULL);
-  void Display(void);
+  virtual void Display(void);
   virtual eOSState ProcessKey(eKeys Key);
   };
 
diff -ruNbw vdr-1.2.2/osdbase.c vdr-1.2.5/osdbase.c
--- vdr-1.2.2/osdbase.c	Sun Mar 23 16:53:29 2003
+++ vdr-1.2.5/osdbase.c	Sun Aug 24 13:38:27 2003
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: osdbase.c 1.8 2003/03/23 15:53:29 kls Exp $
+ * $Id: osdbase.c 1.10 2003/08/24 11:38:27 kls Exp $
  */
 
 #include "osdbase.h"
@@ -70,7 +70,7 @@
 void cPalette::Reset(void)
 {
   for (int i = 0; i < numColors; i++)
-      used[i] = false;
+      used[i] = fetched[i] = false;
   full = false;
 }
 
@@ -215,7 +215,7 @@
      Take(Bitmap, &Indexes);
      for (int ix = 0; ix < Bitmap.width; ix++) {
          for (int iy = 0; iy < Bitmap.height; iy++)
-             SetIndex(x + ix, y + iy, Indexes[Bitmap.bitmap[Bitmap.width * iy + ix]]);
+             SetIndex(x + ix, y + iy, Indexes[int(Bitmap.bitmap[Bitmap.width * iy + ix])]);
          }
      }
 }
diff -ruNbw vdr-1.2.2/plugin.c vdr-1.2.5/plugin.c
--- vdr-1.2.2/plugin.c	Fri May  9 17:01:26 2003
+++ vdr-1.2.5/plugin.c	Sat Aug 30 16:52:58 2003
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: plugin.c 1.9 2003/05/09 15:01:26 kls Exp $
+ * $Id: plugin.c 1.10 2003/08/30 14:52:58 kls Exp $
  */
 
 #include "plugin.h"
@@ -170,7 +170,7 @@
      if (plugin && args) {
         int argc = 0;
         char *argv[MAXPLUGINARGS];
-        char *p = args;
+        char *p = skipspace(stripspace(args));
         char *q = NULL;
         bool done = false;
         while (!done) {
@@ -205,7 +205,7 @@
                                }
                             }
                          if (!done)
-                            p++;
+                            p = *p ? p + 1 : skipspace(p + 1);
                 }
               }
         argv[argc] = NULL;
@@ -278,7 +278,7 @@
         }
      return;
      }
-  char *s = strdup(Args);
+  char *s = strdup(skipspace(Args));
   char *p = strchr(s, ' ');
   if (p)
      *p = 0;
diff -ruNbw vdr-1.2.2/recording.c vdr-1.2.5/recording.c
--- vdr-1.2.2/recording.c	Fri May 30 15:23:54 2003
+++ vdr-1.2.5/recording.c	Tue Sep  9 18:02:55 2003
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: recording.c 1.80 2003/05/30 13:23:54 kls Exp $
+ * $Id: recording.c 1.83 2003/09/09 16:02:55 kls Exp $
  */
 
 #include "recording.h"
@@ -95,7 +95,8 @@
   // a file, or mark a file for removal ("delete" it), so that
   // it will get removed during the next call.
   static time_t LastFreeDiskCheck = 0;
-  if (time(NULL) - LastFreeDiskCheck > DISKCHECKDELTA) {
+  int Factor = (Priority == -1) ? 10 : 1;
+  if (time(NULL) - LastFreeDiskCheck > DISKCHECKDELTA / Factor) {
      if (!VideoFileSpaceAvailable(MINDISKSPACE)) {
         // Make sure only one instance of VDR does this:
         cLockFile LockFile(VideoDirectory);
@@ -113,7 +114,7 @@
                  r = Recordings.Next(r);
                  }
            if (r0 && r0->Remove()) {
-              LastFreeDiskCheck += REMOVELATENCY;
+              LastFreeDiskCheck += REMOVELATENCY / Factor;
               return;
               }
            }
@@ -770,7 +771,7 @@
 #define INDEXFILESUFFIX     "/index.vdr"
 
 // The number of frames to stay off the end in case of time shift:
-#define INDEXSAFETYLIMIT 100 // frames
+#define INDEXSAFETYLIMIT 150 // frames
 
 // The maximum time to wait before giving up while catching up on an index file:
 #define MAXINDEXCATCHUP   8 // seconds
@@ -858,6 +859,7 @@
 {
   // returns true unless something really goes wrong, so that 'index' becomes NULL
   if (index && f >= 0) {
+     cMutexLock MutexLock(&mutex);
      for (int i = 0; i <= MAXINDEXCATCHUP && (Index < 0 || Index >= last); i++) {
          struct stat buf;
          if (fstat(f, &buf) == 0) {
diff -ruNbw vdr-1.2.2/recording.h vdr-1.2.5/recording.h
--- vdr-1.2.2/recording.h	Sat Oct 19 17:48:52 2002
+++ vdr-1.2.5/recording.h	Tue Sep  9 18:00:56 2003
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: recording.h 1.25 2002/10/19 15:48:52 kls Exp $
+ * $Id: recording.h 1.27 2003/09/09 16:00:56 kls Exp $
  */
 
 #ifndef __RECORDING_H
@@ -12,11 +12,14 @@
 
 #include <time.h>
 #include "config.h"
+#include "thread.h"
 #include "timers.h"
 #include "tools.h"
 
 void RemoveDeletedRecordings(void);
 void AssertFreeDiskSpace(int Priority = 0);
+     ///< The special Priority value -1 means that we shall get rid of any
+     ///< deleted recordings faster than normal (because we're cutting).
 
 class cResumeFile {
 private:
@@ -128,6 +131,7 @@
   int size, last;
   tIndex *index;
   cResumeFile resumeFile;
+  cMutex mutex;
   bool CatchUp(int Index = -1);
 public:
   cIndexFile(const char *FileName, bool Record);
diff -ruNbw vdr-1.2.2/remux.c vdr-1.2.5/remux.c
--- vdr-1.2.2/remux.c	Sat Apr 26 17:07:41 2003
+++ vdr-1.2.5/remux.c	Sun Sep 14 12:34:39 2003
@@ -8,7 +8,7 @@
  * the Linux DVB driver's 'tuxplayer' example and were rewritten to suit
  * VDR's needs.
  *
- * $Id: remux.c 1.15 2003/04/26 15:07:41 kls Exp $
+ * $Id: remux.c 1.17 2003/09/14 10:34:39 kls Exp $
  */
 
 /* The calling interface of the 'cRemux::Process()' function is defined
@@ -321,7 +321,6 @@
                      if ((flag1 & 0xC0) == 0x80 )
                         mpeg = 2;
                      else {
-                        esyslog("ERROR: error in data stream!");
                         hlength = 0;
                         which = 0;
                         mpeg = 1;
@@ -361,6 +360,9 @@
                write_ipack(&hlength, 1);
                }
 
+            if (mpeg == 1 && found == 7)
+               write_ipack(&flag1, 1);
+
             if (mpeg == 2 && (flag2 & PTS_ONLY) && found < 14) {
                while (c < Count && found < 14) {
                      write_ipack(Buf + c, 1);
@@ -670,7 +672,7 @@
 
 void cRemux::SetBrokenLink(uchar *Data, int Length)
 {
-  if (Length > 9 && Data[0] == 0 && Data[1] == 0 && Data[2] == 1 && (Data[3] & VIDEO_STREAM_S) == VIDEO_STREAM_S) {
+  if (Length > 9 && Data[0] == 0 && Data[1] == 0 && Data[2] == 1 && (Data[3] & 0xF0) == VIDEO_STREAM_S) {
      for (int i = Data[8] + 9; i < Length - 7; i++) { // +9 to skip video packet header
          if (Data[i] == 0 && Data[i + 1] == 0 && Data[i + 2] == 1 && Data[i + 3] == 0xB8) {
             if (!(Data[i + 7] & 0x40)) // set flag only if GOP is not closed
diff -ruNbw vdr-1.2.2/runvdr vdr-1.2.5/runvdr
--- vdr-1.2.2/runvdr	Sat Mar 16 17:22:12 2002
+++ vdr-1.2.5/runvdr	Tue Aug 26 18:15:41 2003
@@ -18,7 +18,7 @@
 # See the main source file 'vdr.c' for copyright information and
 # how to reach the author.
 #
-# $Id: runvdr 1.9 2002/03/16 16:22:12 kls Exp $
+# $Id: runvdr 1.11 2003/08/26 16:15:41 kls Exp $
 
 DVBDIR="../DVB/driver"
 VDRPRG="./vdr"
@@ -34,7 +34,7 @@
 
 while (true) do
       su -c "$VDRCMD" $VDRUSR
-      if test $? -eq 0; then exit; fi
+      if test $? -eq 0 -o $? -eq 2; then exit; fi
       date
       echo "restarting VDR"
       $KILL $VDRPRG
diff -ruNbw vdr-1.2.2/svdrp.c vdr-1.2.5/svdrp.c
--- vdr-1.2.2/svdrp.c	Sat Jul 26 12:57:33 2003
+++ vdr-1.2.5/svdrp.c	Sun Aug 31 13:24:47 2003
@@ -10,7 +10,7 @@
  * and interact with the Video Disk Recorder - or write a full featured
  * graphical interface that sits on top of an SVDRP connection.
  *
- * $Id: svdrp.c 1.53 2003/07/26 10:57:33 kls Exp $
+ * $Id: svdrp.c 1.55 2003/08/31 11:24:47 kls Exp $
  */
 
 #include "svdrp.h"
@@ -464,8 +464,30 @@
 
 void cSVDRP::CmdDELC(const char *Option)
 {
-  //TODO combine this with menu action (timers must be updated)
-  Reply(502, "DELC not yet implemented");
+  if (*Option) {
+     if (isnumber(Option)) {
+        cChannel *channel = Channels.GetByNumber(strtol(Option, NULL, 10));
+        if (channel) {
+           for (cTimer *timer = Timers.First(); timer; timer = Timers.Next(timer)) {
+               if (timer->Channel() == channel) {
+                  Reply(550, "Channel \"%s\" is in use by timer %d", Option, timer->Index() + 1);
+                  return;
+                  }
+               }
+           Channels.Del(channel);
+           Channels.ReNumber();
+           Channels.Save();
+           isyslog("channel %s deleted", Option);
+           Reply(250, "Channel \"%s\" deleted", Option);
+           }
+        else
+           Reply(501, "Channel \"%s\" not defined", Option);
+        }
+     else
+        Reply(501, "Error in channel number \"%s\"", Option);
+     }
+  else
+     Reply(501, "Missing channel number");
 }
 
 void cSVDRP::CmdDELR(const char *Option)
@@ -1104,6 +1126,8 @@
               isyslog("lost connection to SVDRP client");
               Close();
               }
+           else
+              break;
            }
      if (Setup.SVDRPTimeout && time(NULL) - lastActivity > Setup.SVDRPTimeout) {
         isyslog("timeout on SVDRP connection");
diff -ruNbw vdr-1.2.2/transfer.c vdr-1.2.5/transfer.c
--- vdr-1.2.2/transfer.c	Sun May 18 17:22:09 2003
+++ vdr-1.2.5/transfer.c	Sun Aug 31 14:19:16 2003
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: transfer.c 1.13 2003/05/18 15:22:09 kls Exp $
+ * $Id: transfer.c 1.14 2003/08/31 12:19:16 kls Exp $
  */
 
 #include "transfer.h"
@@ -13,6 +13,7 @@
 // The size of the array used to buffer video data:
 // (must be larger than MINVIDEODATA - see remux.h)
 #define VIDEOBUFSIZE  MEGABYTE(1)
+#define POLLTIMEOUTS_BEFORE_DEVICECLEAR 3
 
 // --- cTransfer -------------------------------------------------------------
 
@@ -67,6 +68,7 @@
 {
   dsyslog("transfer thread started (pid=%d)", getpid());
 
+  int PollTimeouts = 0;
   active = true;
   while (active) {
 
@@ -99,6 +101,7 @@
               while (Result > 0 && active) {
                     cPoller Poller;
                     if (DevicePoll(Poller, 100)) {
+                       PollTimeouts = 0;
                        int w = PlayVideo(p, Result);
                        if (w > 0) {
                           p += w;
@@ -107,6 +110,13 @@
                        else if (w < 0 && FATALERRNO) {
                           LOG_ERROR;
                           break;
+                          }
+                       }
+                    else {
+                       PollTimeouts++;
+                       if (PollTimeouts == POLLTIMEOUTS_BEFORE_DEVICECLEAR) {
+                          dsyslog("clearing device because of consecutive poll timeouts");
+                          DeviceClear();
                           }
                        }
                     }
diff -ruNbw vdr-1.2.2/vdr.c vdr-1.2.5/vdr.c
--- vdr-1.2.2/vdr.c	Sat Aug  2 16:01:32 2003
+++ vdr-1.2.5/vdr.c	Sun Sep 14 11:36:54 2003
@@ -22,7 +22,7 @@
  *
  * The project's page is at http://www.cadsoft.de/vdr
  *
- * $Id: vdr.c 1.162 2003/08/02 14:01:32 kls Exp $
+ * $Id: vdr.c 1.169 2003/09/14 09:36:54 kls Exp $
  */
 
 #include <getopt.h>
@@ -57,7 +57,6 @@
 #define ACTIVITYTIMEOUT 60 // seconds before starting housekeeping
 #define SHUTDOWNWAIT   300 // seconds to wait in user prompt before automatic shutdown
 #define MANUALSTART    600 // seconds the next timer must be in the future to assume manual start
-#define ZAPTIMEOUT       3 // seconds until a channel counts as "previous" for switching with '0'
 
 static int Interrupted = 0;
 
@@ -200,6 +199,10 @@
           case 's': Shutdown = optarg;
                     break;
           case 't': Terminal = optarg;
+                    if (access(Terminal, R_OK | W_OK) < 0) {
+                       fprintf(stderr, "vdr: can't access terminal: %s\n", Terminal);
+                       return 2;
+                       }
                     break;
           case 'V': DisplayVersion = true;
                     break;
@@ -342,16 +345,18 @@
   cPlugin::SetConfigDirectory(ConfigDirectory);
 
   Setup.Load(AddDirectory(ConfigDirectory, "setup.conf"));
-  Sources.Load(AddDirectory(ConfigDirectory, "sources.conf"), true);
-  Diseqcs.Load(AddDirectory(ConfigDirectory, "diseqc.conf"), true);
-  Channels.Load(AddDirectory(ConfigDirectory, "channels.conf"));
-  Timers.Load(AddDirectory(ConfigDirectory, "timers.conf"));
-  Commands.Load(AddDirectory(ConfigDirectory, "commands.conf"), true);
-  RecordingCommands.Load(AddDirectory(ConfigDirectory, "reccmds.conf"), true);
-  SVDRPhosts.Load(AddDirectory(ConfigDirectory, "svdrphosts.conf"), true);
-  CaDefinitions.Load(AddDirectory(ConfigDirectory, "ca.conf"), true);
-  Keys.Load(AddDirectory(ConfigDirectory, "remote.conf"));
-  KeyMacros.Load(AddDirectory(ConfigDirectory, "keymacros.conf"), true);
+  if (!(Sources.Load(AddDirectory(ConfigDirectory, "sources.conf"), true, true) &&
+        Diseqcs.Load(AddDirectory(ConfigDirectory, "diseqc.conf"), true, Setup.DiSEqC) &&
+        Channels.Load(AddDirectory(ConfigDirectory, "channels.conf"), false, true) &&
+        Timers.Load(AddDirectory(ConfigDirectory, "timers.conf")) &&
+        Commands.Load(AddDirectory(ConfigDirectory, "commands.conf"), true) &&
+        RecordingCommands.Load(AddDirectory(ConfigDirectory, "reccmds.conf"), true) &&
+        SVDRPhosts.Load(AddDirectory(ConfigDirectory, "svdrphosts.conf"), true) &&
+        CaDefinitions.Load(AddDirectory(ConfigDirectory, "ca.conf"), true) &&
+        Keys.Load(AddDirectory(ConfigDirectory, "remote.conf")) &&
+        KeyMacros.Load(AddDirectory(ConfigDirectory, "keymacros.conf"), true)
+        ))
+     return 2;
 
   // DVB interfaces:
 
@@ -382,7 +387,7 @@
         const char *msg = "no primary device found - using first device!";
         fprintf(stderr, "vdr: %s\n", msg);
         esyslog("ERROR: %s", msg);
-        if (!cDevice::SetPrimaryDevice(0))
+        if (!cDevice::SetPrimaryDevice(1))
            return 2;
         if (!cDevice::PrimaryDevice()) {
            const char *msg = "no primary device found - giving up!";
@@ -455,8 +460,8 @@
   cOsdObject *Temp = NULL;
   int LastChannel = -1;
   int LastTimerChannel = -1;
-  int PreviousChannel = cDevice::CurrentChannel();
-  int LastLastChannel = PreviousChannel;
+  int PreviousChannel[2] = { 1, 1 };
+  int PreviousChannelIndex = 0;
   time_t LastChannelChanged = time(NULL);
   time_t LastActivity = 0;
   int MaxLatencyTime = 0;
@@ -498,10 +503,8 @@
            LastChannel = cDevice::CurrentChannel();
            LastChannelChanged = time(NULL);
            }
-        if (LastLastChannel != LastChannel && time(NULL) - LastChannelChanged >= ZAPTIMEOUT) {
-           PreviousChannel = LastLastChannel;
-           LastLastChannel = LastChannel;
-           }
+        if (time(NULL) - LastChannelChanged >= Setup.ZapTimeout && LastChannel != PreviousChannel[0] && LastChannel != PreviousChannel[1])
+           PreviousChannel[PreviousChannelIndex ^= 1] = LastChannel;
         // Timers and Recordings:
         if (!Timers.BeingEdited()) {
            time_t Now = time(NULL); // must do both following calls with the exact same time!
@@ -680,9 +683,9 @@
            switch (key) {
              // Toggle channels:
              case k0: {
-                  int CurrentChannel = cDevice::CurrentChannel();
-                  Channels.SwitchTo(PreviousChannel);
-                  PreviousChannel = CurrentChannel;
+                  if (PreviousChannel[PreviousChannelIndex ^ 1] == LastChannel || LastChannel != PreviousChannel[0] && LastChannel != PreviousChannel[1])
+                     PreviousChannelIndex ^= 1;
+                  Channels.SwitchTo(PreviousChannel[PreviousChannelIndex ^= 1]);
                   break;
                   }
              // Direct Channel Select:
