[FFmpeg-cvslog] r15366 - trunk/ffmpeg.c

michael subversion
Thu Sep 18 23:07:11 CEST 2008


Author: michael
Date: Thu Sep 18 23:07:11 2008
New Revision: 15366

Log:
Support comments in preset files.


Modified:
   trunk/ffmpeg.c

Modified: trunk/ffmpeg.c
==============================================================================
--- trunk/ffmpeg.c	(original)
+++ trunk/ffmpeg.c	Thu Sep 18 23:07:11 2008
@@ -3718,7 +3718,7 @@ static int opt_bsf(const char *opt, cons
 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, c
     }
 
     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);
         }




More information about the ffmpeg-cvslog mailing list