diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-10-18 06:35:31 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-10-18 06:49:56 +0300 |
commit | 49b2bc59477395370065a22ecbe05a36c246bc73 (patch) | |
tree | 1a9d3c4ab59ee9f237c5aa27d7044b16f74e0472 /libmpdemux/demux_lavf.c | |
parent | 75eab4f72af7b10e52ab4f149afb7648b2e145f2 (diff) | |
download | mpv-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/demux_lavf.c')
-rw-r--r-- | libmpdemux/demux_lavf.c | 2 |
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, |