summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-10-18 06:35:31 +0300
committerUoti Urpala <uau@mplayer2.org>2011-10-18 06:49:56 +0300
commit49b2bc59477395370065a22ecbe05a36c246bc73 (patch)
tree1a9d3c4ab59ee9f237c5aa27d7044b16f74e0472 /libmpdemux
parent75eab4f72af7b10e52ab4f149afb7648b2e145f2 (diff)
downloadmpv-49b2bc59477395370065a22ecbe05a36c246bc73.tar.bz2
mpv-49b2bc59477395370065a22ecbe05a36c246bc73.tar.xz
demux_lavf: set rawvideo codec_tag based on pix_fmt
Libav stopped automatically filling missing codec_tag field for raw codecs based on pix_fmt in libav commit bb416bd68c ("lavf: do not set codec_tag for rawvideo"). This broke demux_lavf for raw video in formats like YUV4MPEG, as the video format was not exported from demux_lavf in any form (the information only existed in the pix_fmt field of the struct AVCodecContext from libavformat, and that is not exported). Add an explicit call to avcodec_pix_fmt_to_codec_tag() to set the codec tag again so that selecting the correct raw decoder based on the tag works.
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_lavf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
index 3033af9918..d25ceb8b95 100644
--- a/libmpdemux/demux_lavf.c
+++ b/libmpdemux/demux_lavf.c
@@ -401,6 +401,8 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i)
case PIX_FMT_BGR24:
codec->codec_tag = MKTAG(24, 'R', 'G', 'B');
}
+ if (!codec->codec_tag)
+ codec->codec_tag = avcodec_pix_fmt_to_codec_tag(codec->pix_fmt);
}
if (!codec->codec_tag)
codec->codec_tag = mp_av_codec_get_tag(mp_bmp_taglists,