From 59ee9f78b0cc4fb84ae606fa317d8102ad32a627 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 6 Oct 2012 13:29:37 +0200 Subject: lavfi: do not use av_pix_fmt_descriptors directly. --- libavfilter/vf_crop.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libavfilter/vf_crop.c') diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c index 0270a13e2c..f79f574315 100644 --- a/libavfilter/vf_crop.c +++ b/libavfilter/vf_crop.c @@ -158,7 +158,7 @@ static int config_input(AVFilterLink *link) { AVFilterContext *ctx = link->dst; CropContext *crop = ctx->priv; - const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[link->format]; + const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(link->format); int ret; const char *expr; double res; @@ -177,8 +177,8 @@ static int config_input(AVFilterLink *link) crop->var_values[VAR_POS] = NAN; av_image_fill_max_pixsteps(crop->max_step, NULL, pix_desc); - crop->hsub = av_pix_fmt_descriptors[link->format].log2_chroma_w; - crop->vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h; + crop->hsub = pix_desc->log2_chroma_w; + crop->vsub = pix_desc->log2_chroma_h; if ((ret = av_expr_parse_and_eval(&res, (expr = crop->ow_expr), var_names, crop->var_values, @@ -248,6 +248,7 @@ static int start_frame(AVFilterLink *link, AVFilterBufferRef *picref) AVFilterContext *ctx = link->dst; CropContext *crop = ctx->priv; AVFilterBufferRef *ref2; + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format); int i; ref2 = avfilter_ref_buffer(picref, ~0); @@ -281,8 +282,7 @@ static int start_frame(AVFilterLink *link, AVFilterBufferRef *picref) ref2->data[0] += crop->y * ref2->linesize[0]; ref2->data[0] += crop->x * crop->max_step[0]; - if (!(av_pix_fmt_descriptors[link->format].flags & PIX_FMT_PAL || - av_pix_fmt_descriptors[link->format].flags & PIX_FMT_PSEUDOPAL)) { + if (!(desc->flags & PIX_FMT_PAL || desc->flags & PIX_FMT_PSEUDOPAL)) { for (i = 1; i < 3; i ++) { if (ref2->data[i]) { ref2->data[i] += (crop->y >> crop->vsub) * ref2->linesize[i]; -- cgit v1.2.3