vdr -v ... --edit ignores -v to set videodir

Message ID 52BAC2F7.2030100@tvdr.de
State New
Headers

Commit Message

Klaus Schmidinger Dec. 25, 2013, 11:35 a.m. UTC
  On 16.12.2013 18:11, Marko Mäkelä wrote:
> Hi all,
>
> I am not sure if this was reported already, but I encountered this bug when trying to edit a recording without setting up VDR:
>
> ./vdr -v /tmp/video --edit /tmp/video/Rec_name/2013-08-12.20.58.50.99.rec
>
> Without the attached patch, VDR would try to create /srv/vdr/video, and would fail to cut the recording.
>
> With the patch, VDR successfully cut the recording. The source files were in PES format, and also the new recording is in PES format. Based on a discussion from 2008, this is the expected behaviour. Is there some tool for converting old PES recordings to TS format?
>
>      Marko
>
> --- vdr.c    2013-10-16 12:46:36.000000000 +0300
> +++ vdr.c    2013-12-16 18:47:42.526981566 +0200
> @@ -331,6 +331,7 @@ int main(int argc, char *argv[])
>               }
>               break;
>         case 'e' | 0x100:
> +                    SetVideoDirectory(VideoDirectory);
>               return CutRecording(optarg) ? 0 : 2;
>         case 'E': EpgDataFileName = (*optarg != '-' ? optarg : NULL);
>               break;

I think I'll do it this way:

-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------

This also fixes a possible segfault with --genindex and takes care of any other
places that would need the video directory name to be properly set in the future.

Klaus
  

Comments

Marko Mäkelä Dec. 25, 2013, 2:03 p.m. UTC | #1
On Wed, Dec 25, 2013 at 12:35:19PM +0100, Klaus Schmidinger wrote:
>I think I'll do it this way:

Thanks, this looks OK too. I guess that your patch is against the 
development branch. In 2.0.4, the function is SetVideoDirectory() 
instead of cVideoDirectory::SetName().

	Marko
  
Klaus Schmidinger Dec. 25, 2013, 2:11 p.m. UTC | #2
On 25.12.2013 15:03, Marko Mäkelä wrote:
> On Wed, Dec 25, 2013 at 12:35:19PM +0100, Klaus Schmidinger wrote:
>> I think I'll do it this way:
>
> Thanks, this looks OK too. I guess that your patch is against the development branch. In 2.0.4, the function is SetVideoDirectory() instead of cVideoDirectory::SetName().

Yes, sorry about that.
The patch will be included in version 2.0.5 accordingly.

Klaus
  

Patch

--- vdr.c       2013/12/25 11:01:28     3.6
+++ vdr.c       2013/12/25 11:24:26
@@ -223,6 +223,7 @@ 
    VdrUser = VDR_USER;
  #endif

+  cVideoDirectory::SetName(VideoDirectory);
    cPluginManager PluginManager(DEFAULTPLUGINDIR);

    static struct option long_options[] = {
@@ -443,6 +444,7 @@ 
            case 'v': VideoDirectory = optarg;
                      while (optarg && *optarg && optarg[strlen(optarg) - 1] == '/')
                            optarg[strlen(optarg) - 1] = 0;
+                    cVideoDirectory::SetName(VideoDirectory);
                      break;
            case 'w': if (isnumber(optarg)) {
                         int t = atoi(optarg);
@@ -663,7 +665,6 @@ 

    // Directories:

-  cVideoDirectory::SetName(VideoDirectory);
    if (!ConfigDirectory)
       ConfigDirectory = DEFAULTCONFDIR;
    cPlugin::SetConfigDirectory(ConfigDirectory);