mirror of https://github.com/mpv-player/mpv
vd_lavc: minor simplification
This commit is contained in:
parent
14bd02a034
commit
85e90668ae
|
@ -315,10 +315,7 @@ static void set_from_bih(AVCodecContext *avctx, uint32_t format,
|
||||||
/* AVRn stores huffman table in AVI header */
|
/* AVRn stores huffman table in AVI header */
|
||||||
/* Pegasus MJPEG stores it also in AVI header, but it uses the common
|
/* Pegasus MJPEG stores it also in AVI header, but it uses the common
|
||||||
* MJPG fourcc :( */
|
* MJPG fourcc :( */
|
||||||
if (bih->biSize <= sizeof(*bih))
|
|
||||||
break;
|
|
||||||
av_opt_set_int(avctx, "extern_huff", 1, AV_OPT_SEARCH_CHILDREN);
|
av_opt_set_int(avctx, "extern_huff", 1, AV_OPT_SEARCH_CHILDREN);
|
||||||
mp_lavc_set_extradata(avctx, bih + 1, bih->biSize - sizeof(*bih));
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MP_FOURCC('R','V','1','0'):
|
case MP_FOURCC('R','V','1','0'):
|
||||||
|
@ -333,19 +330,13 @@ static void set_from_bih(AVCodecContext *avctx, uint32_t format,
|
||||||
format == MP_FOURCC('R','V','1','3') ? 0x10003001 : 0x10000000,
|
format == MP_FOURCC('R','V','1','3') ? 0x10003001 : 0x10000000,
|
||||||
};
|
};
|
||||||
mp_lavc_set_extradata(avctx, &extradata, 8);
|
mp_lavc_set_extradata(avctx, &extradata, 8);
|
||||||
} else {
|
|
||||||
// has extra slice header (demux_rm or rm->avi streamcopy)
|
|
||||||
mp_lavc_set_extradata(avctx, bih + 1, bih->biSize - sizeof(*bih));
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
if (bih->biSize <= sizeof(*bih))
|
|
||||||
break;
|
|
||||||
mp_lavc_set_extradata(avctx, bih + 1, bih->biSize - sizeof(*bih));
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bih->biSize > sizeof(*bih) && avctx->extradata_size == 0)
|
||||||
|
mp_lavc_set_extradata(avctx, bih + 1, bih->biSize - sizeof(*bih));
|
||||||
|
|
||||||
avctx->bits_per_coded_sample = bih->biBitCount;
|
avctx->bits_per_coded_sample = bih->biBitCount;
|
||||||
avctx->coded_width = bih->biWidth;
|
avctx->coded_width = bih->biWidth;
|
||||||
avctx->coded_height = bih->biHeight;
|
avctx->coded_height = bih->biHeight;
|
||||||
|
|
Loading…
Reference in New Issue