mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/mvcdec: stop using deprecated avcodec_set_dimensions()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
256b986c04
commit
0610d6e8ae
@ -39,6 +39,7 @@ static av_cold int mvc_decode_init(AVCodecContext *avctx)
|
|||||||
MvcContext *s = avctx->priv_data;
|
MvcContext *s = avctx->priv_data;
|
||||||
int width = avctx->width;
|
int width = avctx->width;
|
||||||
int height = avctx->height;
|
int height = avctx->height;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (avctx->codec_id == AV_CODEC_ID_MVC1) {
|
if (avctx->codec_id == AV_CODEC_ID_MVC1) {
|
||||||
width += 3;
|
width += 3;
|
||||||
@ -46,8 +47,8 @@ static av_cold int mvc_decode_init(AVCodecContext *avctx)
|
|||||||
}
|
}
|
||||||
width &= ~3;
|
width &= ~3;
|
||||||
height &= ~3;
|
height &= ~3;
|
||||||
if (width != avctx->width || height != avctx->height)
|
if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
|
||||||
avcodec_set_dimensions(avctx, width, height);
|
return ret;
|
||||||
|
|
||||||
avctx->pix_fmt = (avctx->codec_id == AV_CODEC_ID_MVC1) ? AV_PIX_FMT_RGB555 : AV_PIX_FMT_BGRA;
|
avctx->pix_fmt = (avctx->codec_id == AV_CODEC_ID_MVC1) ? AV_PIX_FMT_RGB555 : AV_PIX_FMT_BGRA;
|
||||||
s->frame = av_frame_alloc();
|
s->frame = av_frame_alloc();
|
||||||
|
Loading…
Reference in New Issue
Block a user