History

Extend buffer source to accept the time base for the output PTS.

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

Stefano Sabatini committed 16 years ago

Commit 94498ec1 parent 387b4ac4 files · +19 −11Browse files

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

Unified · Split

libavfilter/vsrc_buffer.c+5−2
@@ -33,6 +33,7 @@ typedef struct { · 32 unmodified lines
3333 int has_frame;
3434 int h, w;
3535 enum PixelFormat pix_fmt;
36+ AVRational time_base; ///< time_base to set in the output link
3637 AVRational pixel_aspect;
3738 } BufferSourceContext;
3839
@@ -66,8 +67,9 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) · 27 unmodified lines
6667 char pix_fmt_str[128];
6768 int n = 0;
6869
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);
7173 return AVERROR(EINVAL);
7274 }
7375 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
98100
99101 link->w = c->w;
100102 link->h = c->h;
103+ link->time_base = c->time_base;
101104
102105 return 0;
103106 }

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