VDR creates 2GB files when using --edit (vdr 1.7.16)

Message ID 4D288049.1030401@gmx.de
State New
Headers

Commit Message

Udo Richter Jan. 8, 2011, 3:18 p.m. UTC
  Am 03.01.2011 23:34, schrieb Marco Göbenich:
> tried to cut a one file recording per commandline with vdr 1.7.16, but
> it always creates multiple files splitted after 2GB, used also  "-c
> /etc/vdr" so that vdr knows where to find setup.conf, but it doesen't
> matter.

That's because the editing process is started right on command line
parsing, while the config file is loaded after all parsing is done.

The attached patch is a quick and untested fix, and loads the setup.conf
prior to editing. Make sure you place any -c option before --edit, or it
will not work.

A better approach would be to delay the whole editing until the complete
command line is processed, somewhere short after the setup.conf got
loaded regularly.

Cheers,

Udo
  

Comments

Marco Göbenich Jan. 8, 2011, 8:55 p.m. UTC | #1
Hi!

I think a better approach would be a second commandline parameter e.g. 
--filesize=10G or to (mis)use the new parameter --edit=10G.

Regards

Marco


Am 08.01.2011 16:18, schrieb Udo Richter:
> Am 03.01.2011 23:34, schrieb Marco Göbenich:
>> tried to cut a one file recording per commandline with vdr 1.7.16, but
>> it always creates multiple files splitted after 2GB, used also  "-c
>> /etc/vdr" so that vdr knows where to find setup.conf, but it doesen't
>> matter.
> That's because the editing process is started right on command line
> parsing, while the config file is loaded after all parsing is done.
>
> The attached patch is a quick and untested fix, and loads the setup.conf
> prior to editing. Make sure you place any -c option before --edit, or it
> will not work.
>
> A better approach would be to delay the whole editing until the complete
> command line is processed, somewhere short after the setup.conf got
> loaded regularly.
>
> Cheers,
>
> Udo
>
>
> _______________________________________________
> vdr mailing list
> vdr@linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
  

Patch

--- vdr.c.bak	2011-01-08 16:09:49.000000000 +0100
+++ vdr.c	2011-01-08 16:09:55.000000000 +0100
@@ -282,6 +282,9 @@ 
                     return 2;
                     break;
           case 'e' | 0x100:
+                    if (!ConfigDirectory)
+                       ConfigDirectory = DEFAULTCONFDIR;
+                    Setup.Load(AddDirectory(ConfigDirectory, "setup.conf"));
                     return CutRecording(optarg) ? 0 : 2;
           case 'E': EpgDataFileName = (*optarg != '-' ? optarg : NULL);
                     break;