From fd7dde404d95f9c7f703917578111317d4ab85cd Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 25 Sep 2014 00:59:15 +0200 Subject: video: remove BITMAPINFOHEADER from internal demuxer API MPlayer traditionally did this because it made sense: the most important formats (avi, asf/wmv) used Microsoft formats, and many important decoders (win32 binary codecs) also did. But the world has changed, and I've always wanted to get rid of this thing from the codebase. demux_mkv.c internally still uses it, because, guess what, Matroska has a VfW muxing mode, which uses these data structures natively. --- video/decode/vd_lavc.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'video/decode/vd_lavc.c') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 45ae9fce94..abed77dd2c 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -321,17 +321,6 @@ static int init(struct dec_video *vd, const char *decoder) return 1; } -static void set_from_bih(AVCodecContext *avctx, uint32_t format, - MP_BITMAPINFOHEADER *bih) -{ - if (bih->biSize > sizeof(*bih)) - mp_lavc_set_extradata(avctx, bih + 1, bih->biSize - sizeof(*bih)); - - avctx->bits_per_coded_sample = bih->biBitCount; - avctx->coded_width = bih->biWidth; - avctx->coded_height = bih->biHeight; -} - static void init_avctx(struct dec_video *vd, const char *decoder, struct vd_lavc_hwdec *hwdec) { @@ -402,10 +391,14 @@ static void init_avctx(struct dec_video *vd, const char *decoder, avctx->codec_tag = sh->format; avctx->coded_width = sh->video->disp_w; avctx->coded_height = sh->video->disp_h; + avctx->bits_per_coded_sample = sh->video->bits_per_coded_sample; + + if (sh->video->coded_width && sh->video->coded_height) { + avctx->coded_width = sh->video->coded_width; + avctx->coded_height = sh->video->coded_height; + } - // demux_mkv - if (sh->video->bih) - set_from_bih(avctx, sh->format, sh->video->bih); + mp_lavc_set_extradata(avctx, sh->video->extradata, sh->video->extradata_len); if (mp_rawvideo) { avctx->pix_fmt = imgfmt2pixfmt(sh->format); -- cgit v1.2.3