History

Clarify logic and feedback of the init() function.

Originally committed as revision 24385 to svn://svn.ffmpeg.org/ffmpeg/trunk

Stefano Sabatini committed 16 years ago

Commit b8dddeb1 parent ce1f8531 file · +6 −4Browse files

Showing the changes to libavfilter/vsrc_buffer.c (1 of 1 file). Show all

Unified · Split

libavfilter/vsrc_buffer.c+6−4
@@ -62,12 +62,14 @@ int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, · 61 unmodified lines
6262 static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
6363 {
6464 BufferSourceContext *c = ctx->priv;
65+ int n = 0;
6566
66− if (args && sscanf(args, "%d:%d:%d", &c->w, &c->h, &c->pix_fmt) == 3)
67− return 0;
67+ if (!args || (n = sscanf(args, "%d:%d:%d", &c->w, &c->h, &c->pix_fmt)) != 3) {
68+ av_log(ctx, AV_LOG_ERROR, "Expected 3 arguments, but only %d found in '%s'\n", n, args ? args : "");
69+ return AVERROR(EINVAL);
70+ }
6871
69− av_log(ctx, AV_LOG_ERROR, "init() expected 3 arguments:'%s'\n", args);
70− return -1;
72+ return 0;
7173 }
7274
7375 static int query_formats(AVFilterContext *ctx)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t