lavfi/thumbnail: use avfilter_unref_bufferp() where appropriate.
This commit is contained in:
parent
24f425319d
commit
782993d9e4
@ -135,8 +135,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *frame)
|
|||||||
memset(thumb->frames[i].histogram, 0, sizeof(thumb->frames[i].histogram));
|
memset(thumb->frames[i].histogram, 0, sizeof(thumb->frames[i].histogram));
|
||||||
if (i == best_frame_idx)
|
if (i == best_frame_idx)
|
||||||
continue;
|
continue;
|
||||||
avfilter_unref_buffer(thumb->frames[i].buf);
|
avfilter_unref_bufferp(&thumb->frames[i].buf);
|
||||||
thumb->frames[i].buf = NULL;
|
|
||||||
}
|
}
|
||||||
thumb->n = 0;
|
thumb->n = 0;
|
||||||
|
|
||||||
@ -152,10 +151,8 @@ static av_cold void uninit(AVFilterContext *ctx)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
ThumbContext *thumb = ctx->priv;
|
ThumbContext *thumb = ctx->priv;
|
||||||
for (i = 0; i < thumb->n_frames && thumb->frames[i].buf; i++) {
|
for (i = 0; i < thumb->n_frames && thumb->frames[i].buf; i++)
|
||||||
avfilter_unref_buffer(thumb->frames[i].buf);
|
avfilter_unref_bufferp(&thumb->frames[i].buf);
|
||||||
thumb->frames[i].buf = NULL;
|
|
||||||
}
|
|
||||||
av_freep(&thumb->frames);
|
av_freep(&thumb->frames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user