]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_random.c
avfilter: Constify all AVFilters
[ffmpeg] / libavfilter / vf_random.c
index 1937eae77169c59d88689239a578afe934220d87..5e4c30a3b5f50687b436564bfa2dd9a1ab7f156f 100644 (file)
@@ -113,6 +113,14 @@ next:
     return ret;
 }
 
+static av_cold void uninit(AVFilterContext *ctx)
+{
+    RandomContext *s = ctx->priv;
+
+    for (int i = 0; i < s->nb_frames; i++)
+        av_frame_free(&s->frames[i]);
+}
+
 static const AVFilterPad random_inputs[] = {
     {
         .name         = "default",
@@ -131,12 +139,13 @@ static const AVFilterPad random_outputs[] = {
     { NULL }
 };
 
-AVFilter ff_vf_random = {
+const AVFilter ff_vf_random = {
     .name        = "random",
     .description = NULL_IF_CONFIG_SMALL("Return random frames."),
     .priv_size   = sizeof(RandomContext),
     .priv_class  = &random_class,
     .init        = init,
+    .uninit      = uninit,
     .inputs      = random_inputs,
     .outputs     = random_outputs,
 };