[vlc-devel] Strange problem. Changing command line params in vlc.c does not make a difference

Peter Tap ptrtap at yahoo.com
Fri Mar 30 21:13:50 CEST 2012


Environment: Ubuntu 10.x. VLC source 2.0.1

I have created a module that shows special watermark when a movie is played. 

The following command works as expected:

$ ./vlc --sub-source="mywatermark"  myfile.mp4

The watermark module gets loaded appropriately and the watermark is displayed on screen.

For our purpose, it is mandatory that this module be loaded. As a user may bypass this command line parameter, I customized vlc-source/bin/vlc.c for our needs. In the first line of main(), I replace original argc and argv with my own argc and argv. The new argument list contains my sub-source parameter.

int main( int i_argc, const char *ppsz_argv[] )
    ppsz_argv = GetCmdArguments(i_argc, ppsz_argv, &i_argc);

    for(int i=0;i<i_argc;i++) {
      printf("Arg: %s\n", ppsz_argv[i]);

The print line displays the parameters and they are exactly as I desire, including my "sub-source" parameter. However, when done this way, my filter never gets created.

There are other hard-coded parameters that seem to work except "sub-source" parameter type.

This sounds silly. I don't understand why the parameter works when passed from command line but not when overridden within the main function. 

The only thing I could think of is that VLC is obtaining some parameters from the process table.

I am wondering if anyone has any insight on what could be happening here.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20120330/00cbd3c1/attachment.html>

More information about the vlc-devel mailing list