[MPlayer-users] my solution: tv option parser or doc bug

Franz Dollinger Franz_Dollinger at t-online.de
Wed Dec 26 20:57:42 CET 2001


In this list someone reported a problem with parsing of command line
options for TV-input.

I`m not subscribed to mplayer-users and I don`t know whether this is
the right way to submit solutions, but if anyone is interested in the
solution that seemed to work on my place, here it comes. 
No extensive testing done, just parsing of the parameters runs with that modification:

I changed cfgparser.c by including memory allocation/freeing for
subopt/subparam into the while loop:

diff cfgparser.c.org  cfgparser.c
252,254d251
<                       subparam = malloc(strlen(param)+1);
<                       subopt = malloc(strlen(param)+1);
< 
263a261,263
>                           subparam = malloc(strlen(param)+1);
>                           subopt = malloc(strlen(param)+1);
> 
283a284,285
>                           free(subparam);
>                           free(subopt);
286,287d287
<                       free(subparam);
<                       free(subopt);

HTH
  Franz

P.S.: great program!!!




More information about the MPlayer-users mailing list