[FFmpeg-devel] [PATCH 06/42] avcodec/vp8: Use RefStruct API for seg_map

Anton Khirnov anton at khirnov.net
Mon Oct 2 12:44:30 EEST 2023


Quoting Andreas Rheinhardt (2023-09-19 21:56:58)
> @@ -139,11 +138,7 @@ static int vp8_ref_frame(VP8Context *s, VP8Frame *dst, const VP8Frame *src)
>  
>      if ((ret = ff_thread_ref_frame(&dst->tf, &src->tf)) < 0)
>          return ret;
> -    if (src->seg_map &&
> -        !(dst->seg_map = av_buffer_ref(src->seg_map))) {
> -        vp8_release_frame(s, dst);
> -        return AVERROR(ENOMEM);
> -    }
> +    ff_refstruct_replace(&dst->seg_map, src->seg_map);

It seems misleading to use replace rather than ref when dst is clean at
this point.

Otherwise looks ok.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list