]> git.sesse.net Git - ffmpeg/commitdiff
lavf: do not set codec_tag for rawvideo
authorMans Rullgard <mans@mansr.com>
Sun, 17 Jul 2011 15:02:33 +0000 (16:02 +0100)
committerMans Rullgard <mans@mansr.com>
Sun, 25 Sep 2011 13:07:21 +0000 (14:07 +0100)
If the demuxer did not set a codec_tag, there is none and
inventing one makes no sense.  This change stops the rawvideo
"decoder" over-writing user-supplied pixfmt with one derived
from the codec_tag.  The pixfmt-codec_tag-pixfmt round-trip
is lossy since several pixfmts map to the same codec_tag.

This fixes fate-lavf-pixfmt with avfilter disabled.

Signed-off-by: Mans Rullgard <mans@mansr.com>
libavformat/utils.c

index 17b342e8ad333ed3a1e3964c7a1ec45240e05caf..b59cde0a2f0712e039f5f109c4efd252d3fec58f 100644 (file)
@@ -2418,9 +2418,6 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
                      (st->codec_info_nb_frames-2)*(int64_t)st->time_base.den,
                       st->info->codec_info_duration*(int64_t)st->time_base.num, 60000);
         if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
-            if(st->codec->codec_id == CODEC_ID_RAWVIDEO && !st->codec->codec_tag && !st->codec->bits_per_coded_sample)
-                st->codec->codec_tag= avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt);
-
             // the check for tb_unreliable() is not completely correct, since this is not about handling
             // a unreliable/inexact time base, but a time base that is finer than necessary, as e.g.
             // ipmovie.c produces.