diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-04-26 18:16:48 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-04-26 18:16:48 +0200 |
commit | a38cdfde5285700fc8a4db3592f9cca287079265 (patch) | |
tree | adbc3737a505c665e27154e17f1bfbe307447f41 /libavfilter | |
parent | ad0193bf9cb258695a7f929954edd6e2e51de4d9 (diff) | |
download | ffmpeg-a38cdfde5285700fc8a4db3592f9cca287079265.tar.gz |
vsrc_buffer: Set output size
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vsrc_buffer.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavfilter/vsrc_buffer.c b/libavfilter/vsrc_buffer.c index 3e7fe9726f..797cc986fa 100644 --- a/libavfilter/vsrc_buffer.c +++ b/libavfilter/vsrc_buffer.c @@ -35,6 +35,7 @@ typedef struct { enum PixelFormat pix_fmt; AVRational time_base; ///< time_base to set in the output link AVRational pixel_aspect; + char sws_param[256]; } BufferSourceContext; int av_vsrc_buffer_add_frame2(AVFilterContext *buffer_filter, AVFrame *frame, @@ -53,6 +54,10 @@ int av_vsrc_buffer_add_frame2(AVFilterContext *buffer_filter, AVFrame *frame, //return -1; } + if(!c->sws_param[0]){ + snprintf(c->sws_param, 255, "%d:%d:%s", c->w, c->h, sws_param); + } + if(width != c->w || height != c->h || pix_fmt != c->pix_fmt){ AVFilterContext *scale= buffer_filter->outputs[0]->dst; AVFilterLink *link; @@ -67,7 +72,7 @@ int av_vsrc_buffer_add_frame2(AVFilterContext *buffer_filter, AVFrame *frame, if(avfilter_open(&scale, f, "Input equalizer") < 0) return -1; - if((ret=avfilter_init_filter(scale, sws_param, NULL))<0){ + if((ret=avfilter_init_filter(scale, c->sws_param, NULL))<0){ avfilter_free(scale); return ret; } |