encoder/encoder.c
/* x264_param_t/rc子结构 */
if( h->param.rc.psz_stat_out ) /* 字符串(char *) */
h->param.rc.psz_stat_out = strdup( h->param.rc.psz_stat_out ); /* */
if( h->param.rc.psz_stat_in ) /* 字符串(char *) */
h->param.rc.psz_stat_in = strdup( h->param.rc.psz_stat_in ); /* */
if( h->param.rc.psz_rc_eq ) /* 字符串(char *) */
h->param.rc.psz_rc_eq = strdup( h->param.rc.psz_rc_eq ); /* */
strdup实际上是新malloc出一块新的内存
/*
头文件:#include <string.h>
用法:char *strdup(char *s);
功能:复制字符串s
说明:返回指向被复制的字符串的指针(新字符串),所需空间由malloc()分配且可以由free()释放。
例子:
char *s="Golden Global View";
char *d;
clrscr();
d=strdup(s);
printf("%s",d);
free(d);
*/