summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2019-05-23 22:20:44 +0200
committerMarton Balint <cus@passwd.hu>2019-05-24 21:39:07 +0200
commit1eb54323c82ff6eff18553fd3f2788a695bdf812 (patch)
treec891125a3d264f4c0c7643cec5de92be69df878f
parent87e0247a6c0f281158425d0f4958f1f1090bc15b (diff)
downloadffmpeg-1eb54323c82ff6eff18553fd3f2788a695bdf812.tar.gz
avfilter/f_loop: warn about unset loop sizes
Signed-off-by: Marton Balint <cus@passwd.hu>
-rw-r--r--libavfilter/f_loop.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavfilter/f_loop.c b/libavfilter/f_loop.c
index fcbd742eb4..5ec44d9da2 100644
--- a/libavfilter/f_loop.c
+++ b/libavfilter/f_loop.c
@@ -55,6 +55,15 @@ typedef struct LoopContext {
#define VFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
#define OFFSET(x) offsetof(LoopContext, x)
+static void check_size(AVFilterContext *ctx)
+{
+ LoopContext *s = ctx->priv;
+
+ if (!s->size)
+ av_log(ctx, AV_LOG_WARNING, "Number of %s to loop is not set!\n",
+ ctx->input_pads[0].type == AVMEDIA_TYPE_VIDEO ? "frames" : "samples");
+}
+
#if CONFIG_ALOOP_FILTER
static int aconfig_input(AVFilterLink *inlink)
@@ -67,6 +76,8 @@ static int aconfig_input(AVFilterLink *inlink)
if (!s->fifo || !s->left)
return AVERROR(ENOMEM);
+ check_size(ctx);
+
return 0;
}
@@ -250,6 +261,8 @@ static av_cold int init(AVFilterContext *ctx)
if (!s->frames)
return AVERROR(ENOMEM);
+ check_size(ctx);
+
return 0;
}