[PATCH 13/13] Use av_codec_get_tag() for computing the codec_tag of the output stream only if the output stream is not rawvideo.

Stefano Sabatini stefano.sabatini-lala
Wed Jun 2 19:25:51 CEST 2010


For rawvideo streams, the codec tag needs to be computed in the
encoder (check for example libavcodec/rawenc.c), and is based on the
pixel format.
---
 libavformat/utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3f14ad8..f4adcce 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2663,7 +2663,7 @@ int av_write_header(AVFormatContext *s)
                            tagbuf, st->codec->codec_tag, st->codec->codec->name);
                     return AVERROR_INVALIDDATA;
                 }
-            }else
+            } else if (st->codec->codec_id != CODEC_ID_RAWVIDEO)
                 st->codec->codec_tag= av_codec_get_tag(s->oformat->codec_tag, st->codec->codec_id);
         }
 
-- 
1.7.1


--gatW/ieO32f1wygP--



More information about the ffmpeg-devel mailing list