[FFmpeg-devel] [PATCH] Warn about decoders setting pix_fmts.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Jan 15 23:17:56 CET 2012


I can't say which we should do, but the current situation with
half the decoders specifying pix_fmts and the other half not
does not seem sensible.
This is one proposal of how we could enforce consistency.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
---
 libavcodec/utils.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 913952a..0f7ad1a 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -131,6 +131,8 @@ void avcodec_register(AVCodec *codec)
 
     if (codec->init_static_data)
         codec->init_static_data(codec);
+    if (!codec->encode && codec->pix_fmts)
+        av_log(NULL, AV_LOG_WARNING, "Decoder %s incorrectly specifies pix_fmts\n", codec->name);
 }
 
 unsigned avcodec_get_edge_width(void)
-- 
1.7.8.3



More information about the ffmpeg-devel mailing list