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/dirac.c | |
parent | 7d1c79f533e0c80cbcda60d3cbd8216551a1bac5 (diff) | |
download | ffmpeg-4ada428aae2f4ab42c6cebc0d7591c0e62db6fe2.tar.gz |
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/dirac.c')
-rw-r--r-- | libavcodec/dirac.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/dirac.c b/libavcodec/dirac.c index 027ce79a2e..d5870d6c00 100644 --- a/libavcodec/dirac.c +++ b/libavcodec/dirac.c @@ -147,6 +147,7 @@ static int parse_source_parameters(AVDiracSeqHeader *dsh, GetBitContext *gb, unsigned luma_depth = 8, luma_offset = 16; int idx; int chroma_x_shift, chroma_y_shift; + int ret; /* [DIRAC_STD] 10.3.2 Frame size. frame_size(video_params) */ /* [DIRAC_STD] custom_dimensions_flag */ @@ -269,7 +270,10 @@ static int parse_source_parameters(AVDiracSeqHeader *dsh, GetBitContext *gb, return AVERROR_INVALIDDATA; dsh->pix_fmt = dirac_pix_fmt[dsh->chroma_format][dsh->pixel_range_index-2]; - avcodec_get_chroma_sub_sample(dsh->pix_fmt, &chroma_x_shift, &chroma_y_shift); + ret = av_pix_fmt_get_chroma_sub_sample(dsh->pix_fmt, &chroma_x_shift, &chroma_y_shift); + if (ret) + return ret; + if ((dsh->width % (1<<chroma_x_shift)) || (dsh->height % (1<<chroma_y_shift))) { if (log_ctx) av_log(log_ctx, AV_LOG_ERROR, "Dimensions must be an integer multiple of the chroma subsampling\n"); |