diff options
author | Martin Vignali <martin.vignali@gmail.com> | 2017-11-06 22:39:16 +0100 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-11-06 19:13:03 -0300 |
commit | 4ada428aae2f4ab42c6cebc0d7591c0e62db6fe2 (patch) | |
tree | 64ff90f19d094203be823c34caf0da5e8390eb61 /libavcodec/mjpegdec.c | |
parent | 7d1c79f533e0c80cbcda60d3cbd8216551a1bac5 (diff) |
avcodec: remove remaining uses of avcodec_get_chroma_sub_sample
Replace them with av_pix_fmt_get_chroma_sub_sample.
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r-- | libavcodec/mjpegdec.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index d980ac99a1..e005dd0cd3 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -2428,7 +2428,10 @@ the_end: avctx->pix_fmt == AV_PIX_FMT_GBRP || avctx->pix_fmt == AV_PIX_FMT_GBRAP ); - avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift); + ret = av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift); + if (ret) + return ret; + av_assert0(s->nb_components == av_pix_fmt_count_planes(s->picture_ptr->format)); for (p = 0; p<s->nb_components; p++) { uint8_t *line = s->picture_ptr->data[p]; @@ -2487,7 +2490,10 @@ the_end: avctx->pix_fmt == AV_PIX_FMT_GBRP || avctx->pix_fmt == AV_PIX_FMT_GBRAP ); - avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift); + ret = av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift); + if (ret) + return ret; + av_assert0(s->nb_components == av_pix_fmt_count_planes(s->picture_ptr->format)); for (p = 0; p < s->nb_components; p++) { uint8_t *dst; @@ -2515,7 +2521,10 @@ the_end: } if (s->flipped && !s->rgb) { int j; - avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift); + ret = av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift); + if (ret) + return ret; + av_assert0(s->nb_components == av_pix_fmt_count_planes(s->picture_ptr->format)); for (index=0; index<s->nb_components; index++) { uint8_t *dst = s->picture_ptr->data[index]; |