summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
Diffstat (limited to 'video')
-rw-r--r--video/decode/vd_lavc.c21
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);