summaryrefslogtreecommitdiff
path: root/libavfilter/vf_crop.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-12 17:04:58 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-12 17:04:58 +0200
commit13afee951a49964abb6d3e2d11644ac9d5ded2c7 (patch)
treeba98a70ac6f80dea08f21badfbbb64319541d826 /libavfilter/vf_crop.c
parentaf7dd79a323090b14a7fb9ef24a3f6a24dc6d2db (diff)
parent59ee9f78b0cc4fb84ae606fa317d8102ad32a627 (diff)
Merge commit '59ee9f78b0cc4fb84ae606fa317d8102ad32a627'
* commit '59ee9f78b0cc4fb84ae606fa317d8102ad32a627': lavfi: do not use av_pix_fmt_descriptors directly. Conflicts: libavfilter/buffersrc.c libavfilter/drawutils.c libavfilter/filtfmts.c libavfilter/vf_ass.c libavfilter/vf_boxblur.c libavfilter/vf_drawtext.c libavfilter/vf_lut.c libavfilter/vf_pad.c libavfilter/vf_scale.c libavfilter/vf_showinfo.c libavfilter/vf_transpose.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_crop.c')
-rw-r--r--libavfilter/vf_crop.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c
index 7218e1756e..17b24c4c36 100644
--- a/libavfilter/vf_crop.c
+++ b/libavfilter/vf_crop.c
@@ -165,7 +165,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;
@@ -186,8 +186,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,
@@ -267,6 +267,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);
@@ -300,8 +301,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];