Make opt_preset() use FFMPEG_DATADIR from config.h rather than /usr and
/usr/local Originally committed as revision 16795 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
1e60e93355
commit
1777168269
11
ffmpeg.c
11
ffmpeg.c
@ -3700,19 +3700,18 @@ static int opt_preset(const char *opt, const char *arg)
|
|||||||
FILE *f=NULL;
|
FILE *f=NULL;
|
||||||
char filename[1000], tmp[1000], tmp2[1000], line[1000];
|
char filename[1000], tmp[1000], tmp2[1000], line[1000];
|
||||||
int i;
|
int i;
|
||||||
const char *base[3]= { getenv("HOME"),
|
const char *base[2]= { getenv("HOME"),
|
||||||
"/usr/local/share",
|
FFMPEG_DATADIR,
|
||||||
"/usr/share",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
for(i=!base[0]; i<3 && !f; i++){
|
for(i=!base[0]; i<2 && !f; i++){
|
||||||
snprintf(filename, sizeof(filename), "%s/%sffmpeg/%s.ffpreset", base[i], i ? "" : ".", arg);
|
snprintf(filename, sizeof(filename), "%s%s/%s.ffpreset", base[i], i ? "" : "/.ffmpeg", arg);
|
||||||
f= fopen(filename, "r");
|
f= fopen(filename, "r");
|
||||||
if(!f){
|
if(!f){
|
||||||
char *codec_name= *opt == 'v' ? video_codec_name :
|
char *codec_name= *opt == 'v' ? video_codec_name :
|
||||||
*opt == 'a' ? audio_codec_name :
|
*opt == 'a' ? audio_codec_name :
|
||||||
subtitle_codec_name;
|
subtitle_codec_name;
|
||||||
snprintf(filename, sizeof(filename), "%s/%sffmpeg/%s-%s.ffpreset", base[i], i ? "" : ".", codec_name, arg);
|
snprintf(filename, sizeof(filename), "%s%s/%s-%s.ffpreset", base[i], i ? "" : "/.ffmpeg", codec_name, arg);
|
||||||
f= fopen(filename, "r");
|
f= fopen(filename, "r");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user