From ef705615765e78bedf97dcdedc22858ef1bab96f Mon Sep 17 00:00:00 2001
From: Christophe Mutricy <xtophe@videolan.org>
Date: Fri, 24 Nov 2006 19:50:37 +0000
Subject: [PATCH] Use LOW_DELAY only with MPEG1/2. Closes #864

---
 modules/codec/ffmpeg/encoder.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/codec/ffmpeg/encoder.c b/modules/codec/ffmpeg/encoder.c
index 1e16ab78f60b..6554cb984ef6 100644
--- a/modules/codec/ffmpeg/encoder.c
+++ b/modules/codec/ffmpeg/encoder.c
@@ -407,7 +407,9 @@ 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 )
+        if( !p_context->max_b_frames  && 
+            (  p_enc->fmt_out.i_codec == VLC_FOURCC('m', 'p', '2', 'v') ||
+               p_enc->fmt_out.i_codec == VLC_FOURCC('m', 'p', '1', 'v') ) )
             p_context->flags |= CODEC_FLAG_LOW_DELAY;
 
         av_reduce( &i_aspect_num, &i_aspect_den,
-- 
GitLab