On Mon, Mar 21, 2016 at 12:03:49AM +0000, Mark Thompson wrote:
> --- /dev/null
> +++ b/libavcodec/vaapi_encode.c
> @@ -0,0 +1,1086 @@
> +static int vaapi_encode_clear_old(AVCodecContext *avctx)
> +{
> + while (ctx->pic_start != ctx->pic_end) {
> + for (pic = old->next; pic; pic = pic->next) {
> + if (pic->encode_complete)
> + continue;
> + for (i = 0; i < pic->nb_refs; i++) {
> + if (pic->refs[i] == old)
> + goto done;
> + }
> + }
> + }
> +
> + done:
> + return 0;
> +}
This seems silly, just skip the goto and return directly.
> +int ff_vaapi_encode2(AVCodecContext *avctx, AVPacket *pkt,
> + const AVFrame *input_image, int *got_packet)
> +{
> + err = vaapi_encode_step(avctx, pic);
> + if (err < 0) {
> + av_log(avctx, AV_LOG_ERROR, "Encode failed: %d.\n", err);
> + goto fail;
> + }
> +
> + err = vaapi_encode_clear_old(avctx);
> + if (err < 0) {
> + av_log(avctx, AV_LOG_ERROR, "List clearing failed: %d.\n", err);
> + goto fail;
> + }
> +
> + return 0;
> +
> +fail:
> + return err;
> +}
same
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel