[FFmpeg-devel] [PATCH] mpeg4videodec: silence "Invalid andinefficient vfw-avi packed B frames detected" warning

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Sep 9 21:22:07 CEST 2013


On Sun, Sep 08, 2013 at 08:31:52PM -0400, Don Moir wrote:
> >On Tue, Sep 03, 2013 at 04:35:35PM -0400, Don Moir wrote:
> >>>Though for some reason this yet again seems to have degenerated into
> >>>an IMO fairly pointless back and forth, with no attention
> >>>or comments that would allow me to understand the issue and where I
> >>>might have misunderstood the problem on the two suggestions I had
> >>
> >>Yes exactly. All I said was I would compile out the warnings if
> >>good... just a switch mind you.. just a comment and not to generate
> >>endless BS
> >>
> >>I expect the name calling to happen next :)
> 
> >>But since it's not something that could be done trivially with a
> >>macro or so I'm not sure it's worth it, but it's interesting to
> >>consider.
> 
> >Possibly not to trivial not sure. One thing is the fatals would have to be separated.
> 
> This seems to work for me but have not tried with GCC.
> 
> in log.h
> 
> #ifdef _NOWARNINGS
>    inline void av_log(void *avc1, int level, const char *fmt,...){}
> #else
>    void av_log(void *avc1, int level, const char *fmt,...);
> #endif
> 
> in log.c av_log (...) would need #ifdef
> 
> fatals still need to be separate

Yes, that's exactly where the problem lies.
So you have to filter out those you do not want.
And then it still needs to be more efficient than the function call.
Then you have to be careful not to mess too much with the public
headers.
However it seems like the below would work, it would just needs
someone to add properly to configure.
It does cause the binary tools to act really weird though, for example
it causes "ffprobe -h" to print a bit of help and then a huge number
of empty lines...

diff --git a/configure b/configure
index 4ff97b4..8d93240 100755
--- a/configure
+++ b/configure
@@ -4819,6 +4819,7 @@ cat > $TMPH <<EOF
 #define EXTERN_ASM ${extern_prefix}
 #define SLIBSUF "$SLIBSUF"
 #define HAVE_MMX2 HAVE_MMXEXT
+#define AV_LOG_MIN_LEVEL AV_LOG_FATAL
 EOF
 
 test -n "$assert_level" &&
diff --git a/libavutil/log.h b/libavutil/log.h
index 7ea95fa..41d21a6 100644
--- a/libavutil/log.h
+++ b/libavutil/log.h
@@ -180,6 +180,18 @@ typedef struct AVClass {
 void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
 
 void av_vlog(void *avcl, int level, const char *fmt, va_list);
+#ifdef AV_LOG_MIN_LEVEL
+static inline void av_log_internal(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
+static inline void av_log_internal(void *avcl, int level, const char *fmt, ...) {
+    if (level <= AV_LOG_MIN_LEVEL) {
+        va_list va;
+        va_start(va, fmt);
+        av_vlog(avcl, level, fmt, va);
+        va_end(va);
+    }
+}
+#define av_log(avcl, ...) av_log_internal(avcl, __VA_ARGS__)
+#endif
 int av_log_get_level(void);
 void av_log_set_level(int);
 void av_log_set_callback(void (*)(void*, int, const char*, va_list));


More information about the ffmpeg-devel mailing list