Originally committed as revision 25451 to svn://svn.ffmpeg.org/ffmpeg/trunk
Showing the changes to libavfilter/vsrc_buffer.c (1 of 4 files). Show all
Unified · Split
| @@ -33,6 +33,7 @@ typedef struct { · 32 unmodified lines | ||
| 33 | 33 | int has_frame; |
| 34 | 34 | int h, w; |
| 35 | 35 | enum PixelFormat pix_fmt; |
| 36 | + AVRational time_base; ///< time_base to set in the output link | |
| 36 | 37 | AVRational pixel_aspect; |
| 37 | 38 | } BufferSourceContext; |
| 38 | 39 | |
| @@ -66,8 +67,9 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) · 27 unmodified lines | ||
| 66 | 67 | char pix_fmt_str[128]; |
| 67 | 68 | int n = 0; |
| 68 | 69 | |
| 69 | − if (!args || (n = sscanf(args, "%d:%d:%127s", &c->w, &c->h, pix_fmt_str)) != 3) { | |
| 70 | − av_log(ctx, AV_LOG_ERROR, "Expected 3 arguments, but only %d found in '%s'\n", n, args ? args : ""); | |
| 70 | + if (!args || | |
| 71 | + (n = sscanf(args, "%d:%d:%127[^:]:%d:%d", &c->w, &c->h, pix_fmt_str, &c->time_base.num, &c->time_base.den)) != 5) { | |
| 72 | + av_log(ctx, AV_LOG_ERROR, "Expected 5 arguments, but only %d found in '%s'\n", n, args); | |
| 71 | 73 | return AVERROR(EINVAL); |
| 72 | 74 | } |
| 73 | 75 | if ((c->pix_fmt = av_get_pix_fmt(pix_fmt_str)) == PIX_FMT_NONE) { |
| @@ -98,6 +100,7 @@ static int config_props(AVFilterLink *link) · 24 unmodified lines | ||
| 98 | 100 | |
| 99 | 101 | link->w = c->w; |
| 100 | 102 | link->h = c->h; |
| 103 | + link->time_base = c->time_base; | |
| 101 | 104 | |
| 102 | 105 | return 0; |
| 103 | 106 | } |