]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/buffersrc.c
avcodec/hnm4video: Cleanup generically on init failure
[ffmpeg] / libavfilter / buffersrc.c
index 72a5ea9370c8b6a5a50efd856e59c2a8345f2852..bf30f54177abc97d463af670a79b04f62816767c 100644 (file)
@@ -51,7 +51,9 @@ typedef struct BufferSourceContext {
     int               w, h;
     enum AVPixelFormat  pix_fmt;
     AVRational        pixel_aspect;
+#if FF_API_SWS_PARAM_OPTION
     char              *sws_param;
+#endif
 
     AVBufferRef *hw_frames_ctx;
 
@@ -238,10 +240,8 @@ static int av_buffersrc_add_frame_internal(AVFilterContext *ctx,
     }
 
     ret = ff_filter_frame(ctx->outputs[0], copy);
-    if (ret < 0) {
-        av_frame_free(&copy);
+    if (ret < 0)
         return ret;
-    }
 
     if ((flags & AV_BUFFERSRC_FLAG_PUSH)) {
         ret = push_frame(ctx->graph);
@@ -271,10 +271,16 @@ static av_cold int init_video(AVFilterContext *ctx)
         return AVERROR(EINVAL);
     }
 
-    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d pixfmt:%s tb:%d/%d fr:%d/%d sar:%d/%d sws_param:%s\n",
+    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d pixfmt:%s tb:%d/%d fr:%d/%d sar:%d/%d\n",
            c->w, c->h, av_get_pix_fmt_name(c->pix_fmt),
            c->time_base.num, c->time_base.den, c->frame_rate.num, c->frame_rate.den,
-           c->pixel_aspect.num, c->pixel_aspect.den, (char *)av_x_if_null(c->sws_param, ""));
+           c->pixel_aspect.num, c->pixel_aspect.den);
+
+#if FF_API_SWS_PARAM_OPTION
+    if (c->sws_param)
+        av_log(ctx, AV_LOG_WARNING, "sws_param option is deprecated and ignored\n");
+#endif
+
     return 0;
 }
 
@@ -296,7 +302,9 @@ static const AVOption buffer_options[] = {
     { "pixel_aspect",  "sample aspect ratio",    OFFSET(pixel_aspect),     AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
     { "time_base",     NULL,                     OFFSET(time_base),        AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
     { "frame_rate",    NULL,                     OFFSET(frame_rate),       AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V },
+#if FF_API_SWS_PARAM_OPTION
     { "sws_param",     NULL,                     OFFSET(sws_param),        AV_OPT_TYPE_STRING,                    .flags = V },
+#endif
     { NULL },
 };
 
@@ -435,8 +443,6 @@ static int config_props(AVFilterLink *link)
 static int request_frame(AVFilterLink *link)
 {
     BufferSourceContext *c = link->src->priv;
-    AVFrame *frame;
-    int ret;
 
     if (c->eof)
         return AVERROR_EOF;