]> git.sesse.net Git - vlc/commitdiff
* modules/codec/ffmpeg/encoder.c: MPEG compliance fixes for large pictures
authorChristophe Massiot <massiot@videolan.org>
Wed, 8 Nov 2006 14:21:01 +0000 (14:21 +0000)
committerChristophe Massiot <massiot@videolan.org>
Wed, 8 Nov 2006 14:21:01 +0000 (14:21 +0000)
   and low delay streams.

modules/codec/ffmpeg/encoder.c

index 0540c9e814d4a82025a1f4edd70be99aa98d9d9a..fc5da1e8c146daeb5bc2d9b686a0b30aeb39945d 100644 (file)
@@ -389,6 +389,9 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
 
         p_context->width = p_enc->fmt_in.video.i_width;
         p_context->height = p_enc->fmt_in.video.i_height;
+        if( p_enc->fmt_out.i_codec == VLC_FOURCC('m', 'p', '2', 'v')
+             && (p_context->width > 720 || p_context->height > 576) )
+            p_context->level = 4; /* High level */
 
 #if LIBAVCODEC_BUILD >= 4754
         p_context->time_base.num = p_enc->fmt_in.video.i_frame_rate_base;
@@ -420,6 +423,8 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
         p_context->max_b_frames =
             __MAX( __MIN( p_sys->i_b_frames, FF_MAX_B_FRAMES ), 0 );
         p_context->b_frame_strategy = 0;
+        if( !p_context->max_b_frames )
+            p_context->flags |= CODEC_FLAG_LOW_DELAY;
 
 #if LIBAVCODEC_BUILD >= 4687
         av_reduce( &i_aspect_num, &i_aspect_den,