[FFmpeg-devel] [PATCH 11/13] Make nut muxer try to get the codec id from ff_raw_pixelFormatTags if ff_codec_get_id() cannot find it.

Stefano Sabatini stefano.sabatini-lala
Sun May 9 16:29:29 CEST 2010


This allows the muxer to use the Nut rawvideo pixel formats codec tags
specified in ff_raw_pixelFormatTags.
---
 libavformat/nutdec.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 522affb..c480b9e 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -21,6 +21,7 @@
  */
 
 #include <strings.h>
+#include "libavcodec/internal.h"
 #include "libavutil/avstring.h"
 #include "libavutil/bswap.h"
 #include "libavutil/tree.h"
@@ -317,6 +318,9 @@ static int decode_stream_header(NUTContext *nut){
         case 0:
             st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
             st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tmp);
+            if (!st->codec->codec_id &&
+                ff_get_pix_fmt_from_codec_tag(ff_raw_pixelFormatTags, tmp) != PIX_FMT_NONE)
+                st->codec->codec_id = CODEC_ID_RAWVIDEO;
             break;
         case 1:
             st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-- 
1.7.0




More information about the ffmpeg-devel mailing list