Use av_frame_copy() to simplify code where appropriate.
This commit is contained in:
parent
8feac29cc4
commit
30517a9f05
@ -161,9 +161,7 @@ static int libwebp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
ret = av_frame_get_buffer(alt_frame, 32);
|
ret = av_frame_get_buffer(alt_frame, 32);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto end;
|
goto end;
|
||||||
av_image_copy(alt_frame->data, alt_frame->linesize,
|
av_frame_copy(alt_frame, frame);
|
||||||
frame->data, frame->linesize,
|
|
||||||
avctx->pix_fmt, frame->width, frame->height);
|
|
||||||
frame = alt_frame;
|
frame = alt_frame;
|
||||||
}
|
}
|
||||||
pic->use_argb = 0;
|
pic->use_argb = 0;
|
||||||
|
@ -37,9 +37,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
|||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
av_frame_copy_props(out, in);
|
av_frame_copy_props(out, in);
|
||||||
av_image_copy(out->data, out->linesize, in->data, in->linesize,
|
av_frame_copy(out, in);
|
||||||
in->format, in->width, in->height);
|
|
||||||
|
|
||||||
av_frame_free(&in);
|
av_frame_free(&in);
|
||||||
return ff_filter_frame(outlink, out);
|
return ff_filter_frame(outlink, out);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user