diff options
author | wm4 <wm4@nowhere> | 2014-09-25 00:59:15 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-09-25 00:59:15 +0200 |
commit | fd7dde404d95f9c7f703917578111317d4ab85cd (patch) | |
tree | 2b33caab9d5d2c0e31f7d16246460d22a9c148ea /video | |
parent | e977624d8723ab8c129e8cefc5bdac31aa8a9475 (diff) | |
download | mpv-fd7dde404d95f9c7f703917578111317d4ab85cd.tar.bz2 mpv-fd7dde404d95f9c7f703917578111317d4ab85cd.tar.xz |
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.
Diffstat (limited to 'video')
-rw-r--r-- | video/decode/vd_lavc.c | 21 |
1 files changed, 7 insertions, 14 deletions
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); |