aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-09-18 21:07:11 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-09-18 21:07:11 +0000
commit8a4f816a6dd8a3a6da9b6569377e935efd255614 (patch)
treeb8042a9e8b2ae30491a3fee3e1d3e75aa1c00808 /ffmpeg.c
parent96b52f9e04a82fdfcaa5abe5ce1c49bcf8fe64f8 (diff)
downloadffmpeg-8a4f816a6dd8a3a6da9b6569377e935efd255614.tar.gz
Support comments in preset files.
Originally committed as revision 15366 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 781001a2f5..d9027aeaff 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3718,7 +3718,7 @@ static int opt_bsf(const char *opt, const char *arg)
static int opt_preset(const char *opt, const char *arg)
{
FILE *f=NULL;
- char tmp[1000], tmp2[1000];
+ char tmp[1000], tmp2[1000], line[1000];
int i;
const char *base[3]= { getenv("HOME"),
"/usr/local/share",
@@ -3743,8 +3743,11 @@ static int opt_preset(const char *opt, const char *arg)
}
while(!feof(f)){
- int e= fscanf(f, "%999[^=]=%999[^\n]\n", tmp, tmp2);
- if(e!=2){
+ int e= fscanf(f, "%999[^\n]\n", line) - 1;
+ if(line[0] == '#' && !e)
+ continue;
+ e|= sscanf(line, "%999[^=]=%999[^\n]\n", tmp, tmp2) - 2;
+ if(e){
fprintf(stderr, "Preset file invalid\n");
av_exit(1);
}