[FFmpeg-devel] regression - mpeg2 interlace/topfield flags not set anymore

christophelorenz christophelorenz
Sun Jan 27 00:35:24 CET 2008


Diego Biurrun wrote:

> This would be much more readable if you provided a (unified) diff.

You're sooo right about this.
Humans always make mistakes.... as I did, wrong line number...


Here's a diff that fixes the problem on the latest rev.

ffmpeg.c
===================================================================
--- /ffmpeg/ffmpeg.c    (revision 11627)
+++ /ffmpeg/ffmpeg.c    (working copy)
@@ -2887,11 +2887,10 @@
         codec = avcodec_find_encoder(codec_id);
 
         for(i=0; i<opt_name_count; i++){
-            char buf[256];
-            const AVOption *opt;
-            const char *str= 
av_get_string(avctx_opts[CODEC_TYPE_VIDEO], opt_names[i], &opt, buf, 
sizeof(buf));
-            if(str && (opt->flags & AV_OPT_FLAG_VIDEO_PARAM) && 
(opt->flags & AV_OPT_FLAG_ENCODING_PARAM))
-                av_set_string(video_enc, opt_names[i], str);
+             const AVOption *opt;
+             double d= av_get_double(avctx_opts[CODEC_TYPE_VIDEO], 
opt_names[i], &opt);
+             if(!isnan(d) && (opt->flags&AV_OPT_FLAG_VIDEO_PARAM) && 
(opt->flags&AV_OPT_FLAG_ENCODING_PARAM))
+                 av_set_double(video_enc, opt_names[i], d);
         }
 
         video_enc->time_base.den = fps.num;





More information about the ffmpeg-devel mailing list