[FFmpeg-devel] [PATCH] ffmpeg: release the last_frame before the decoders are closed

James Almer jamrial at gmail.com
Tue Oct 16 17:02:18 EEST 2018


On 10/16/2018 9:16 AM, Steve Lhomme wrote:
> If the decoder provides its own buffers it might not be able to release its
> buffers once it has been closed. (this is the case with dav1d).
> ---
>  fftools/ffmpeg.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index da4259a9a8..faf62475a2 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -4738,6 +4738,7 @@ static int transcode(void)
>          if (ost->encoding_needed) {
>              av_freep(&ost->enc_ctx->stats_in);
>          }
> +        av_frame_unref(ost->last_frame);
>          total_packets_written += ost->packets_written;
>      }

I'm not against this change, but this issue should be solved within
dav1d as well. Either the caller fully owns the picture returned by
dav1d, or it doesn't. "Partially owns it while some other context is
still valid" is not really acceptable.


More information about the ffmpeg-devel mailing list