diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-10-12 18:40:20 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-10-12 18:40:20 +0000 |
commit | 94498ec98a9f0807b0d418beb5f6a0c76318d074 (patch) | |
tree | a3128da5452650781d1ee2f2bc50e221703d3392 /libavfilter/vsrc_buffer.c | |
parent | 387b4ac993528d6e25b3d6fe49d5d360b8e62e98 (diff) | |
download | ffmpeg-streaming-94498ec98a9f0807b0d418beb5f6a0c76318d074.zip ffmpeg-streaming-94498ec98a9f0807b0d418beb5f6a0c76318d074.tar.gz |
Extend buffer source to accept the time base for the output PTS.
Originally committed as revision 25451 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter/vsrc_buffer.c')
-rw-r--r-- | libavfilter/vsrc_buffer.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavfilter/vsrc_buffer.c b/libavfilter/vsrc_buffer.c index fa9d135..74d9bf6 100644 --- a/libavfilter/vsrc_buffer.c +++ b/libavfilter/vsrc_buffer.c @@ -33,6 +33,7 @@ typedef struct { int has_frame; int h, w; enum PixelFormat pix_fmt; + AVRational time_base; ///< time_base to set in the output link AVRational pixel_aspect; } BufferSourceContext; @@ -66,8 +67,9 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) char pix_fmt_str[128]; int n = 0; - if (!args || (n = sscanf(args, "%d:%d:%127s", &c->w, &c->h, pix_fmt_str)) != 3) { - av_log(ctx, AV_LOG_ERROR, "Expected 3 arguments, but only %d found in '%s'\n", n, args ? args : ""); + if (!args || + (n = sscanf(args, "%d:%d:%127[^:]:%d:%d", &c->w, &c->h, pix_fmt_str, &c->time_base.num, &c->time_base.den)) != 5) { + av_log(ctx, AV_LOG_ERROR, "Expected 5 arguments, but only %d found in '%s'\n", n, args); return AVERROR(EINVAL); } if ((c->pix_fmt = av_get_pix_fmt(pix_fmt_str)) == PIX_FMT_NONE) { @@ -98,6 +100,7 @@ static int config_props(AVFilterLink *link) link->w = c->w; link->h = c->h; + link->time_base = c->time_base; return 0; } |