From 9f0a705d46547ca0c3edab21f24cdb0fb3237185 Mon Sep 17 00:00:00 2001
From: Andrew Savchenko <Bircoph@list.ru>
Date: Tue, 4 Nov 2008 06:54:42 +0000
Subject: [PATCH] Only warn about "Invalid and inefficient vfw-avi packed B
 frames" once.

Patch by Andrew Savchenko, Bircoph at list dot ru

Originally committed as revision 15772 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavcodec/h263.c      | 4 +++-
 libavcodec/mpegvideo.h | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/h263.c b/libavcodec/h263.c
index 47210e9c9e..f72f440348 100644
--- a/libavcodec/h263.c
+++ b/libavcodec/h263.c
@@ -5751,8 +5751,10 @@ static int decode_user_data(MpegEncContext *s, GetBitContext *gb){
         s->divx_version= ver;
         s->divx_build= build;
         s->divx_packed= e==3 && last=='p';
-        if(s->divx_packed)
+        if(s->divx_packed && !s->showed_packed_warning) {
             av_log(s->avctx, AV_LOG_WARNING, "Invalid and inefficient vfw-avi packed B frames detected\n");
+            s->showed_packed_warning=1;
+        }
     }
 
     /* ffmpeg detection */
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index aaffb86ef0..4ddd30c483 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -487,6 +487,7 @@ typedef struct MpegEncContext {
     /* H.263 specific */
     int gob_index;
     int obmc;                       ///< overlapped block motion compensation
+    int showed_packed_warning;      ///< flag for having shown the warning about divxs invalid b frames
 
     /* H.263+ specific */
     int umvplus;                    ///< == H263+ && unrestricted_mv