[FFmpeg-cvslog] r15348 - in trunk/ffpresets: . libx264-default.ffpreset libx264-fastfirstpass.ffpreset libx264-hq.ffpreset libx264-max.ffpreset libx264-normal.ffpreset

Kostya kostya.shishkov
Thu Sep 18 18:12:53 CEST 2008


On Thu, Sep 18, 2008 at 05:41:23PM +0200, Michael Niedermayer wrote:
> On Wed, Sep 17, 2008 at 08:16:32PM -0700, Mike Melanson wrote:
> > > [...]
> > > 
> > > Is it possible to include comments in a preset file?
> > 
> > The preset file parser makes no provisions for comments (see 
> > ffmpeg.c:opt_preset()). Do you really think Michael is going to let such 
> > a user-friendly feature through?
> 
> Iam not against supporting comments. -> patch welcome

Theoretical but should work
 
> [...]
> -- 
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
-------------- next part --------------
--- /home/kst/cvs-get/ffmpeg/ffmpeg.c	2008-09-18 08:10:49.000000000 +0300
+++ ffmpeg.c	2008-09-18 19:11:22.000000000 +0300
@@ -3743,7 +3743,14 @@
     }
 
     while(!feof(f)){
-        int e= fscanf(f, "%999[^=]=%999[^\n]\n", tmp, tmp2);
+        int e, c;
+        c= getc(f);
+        if(c == '#'){
+            while(!feof(f) && getc(f) != '\n');
+            continue;
+        }
+        ungetc(c, f);
+        e= fscanf(f, "%999[^=]=%999[^\n]\n", tmp, tmp2);
         if(e!=2){
             fprintf(stderr, "Preset file invalid\n");
             av_exit(1);



More information about the ffmpeg-cvslog mailing list