From 0298af4887e4ffa70f1f2ff4dd2dbe819cdace97 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 6 Oct 2002 17:46:22 +0000 Subject: [PATCH] set low_delay on encoding if no b frames Originally committed as revision 1007 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/mpegvideo.c | 2 +- tests/ffmpeg.regression.ref | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 5785e85d25..e5d6adcd6c 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -596,7 +596,7 @@ int MPV_encode_init(AVCodecContext *avctx) s->h263_pred = 1; s->unrestricted_mv = 1; s->has_b_frames= s->max_b_frames ? 1 : 0; - s->low_delay=0; + s->low_delay= !s->has_b_frames; avctx->delay= s->low_delay ? 0 : (s->max_b_frames + 1); break; case CODEC_ID_MSMPEG4V1: diff --git a/tests/ffmpeg.regression.ref b/tests/ffmpeg.regression.ref index 1c99e33328..8a2622e868 100644 --- a/tests/ffmpeg.regression.ref +++ b/tests/ffmpeg.regression.ref @@ -9,12 +9,12 @@ ffmpeg regression test 3ed8e11a8a8147c3e7d736593fccae79 *./data/out.yuv abe11239875a32f00fa2910828bba4fb *./data/a-h263.avi c1f6c8ee7a24d8345deddf1a24ca3756 *./data/out.yuv -440192aca11c310e01168ec24ea7807e *./data/a-odivx.avi -145c98a175e760f8ba1997edf15b2964 *./data/out.yuv +8e41ac530894eaf3ecdb583d6d66c392 *./data/a-odivx.avi +bf3be8fb78a9ca91dd6b252d48ce59bb *./data/out.yuv 850ba6da4c9dad60b6719b0b06b204de *./data/a-mpeg4-rc.avi 0ab0a58082e485478f9feab5ccc6fc42 *./data/out.yuv -f5f44dad09c2d4d16524e539645f693c *./data/a-mpeg4-adv.avi -d0f077a3b42367d7432b73c0ddad7438 *./data/out.yuv +685812396445ac5c79f345965dca6b09 *./data/a-mpeg4-adv.avi +1d6c3ba2b096ac6df63f1dcabe3ed603 *./data/out.yuv 2846c8e3d97d7395eb746bfce44e0443 *./data/a-mjpeg.avi 278033451d7a6bfeb8339abbe4228499 *./data/out.yuv ccbf683d781fa3cdfa18b618731fc74b *./data/a-rv10.rm