| @@ -35,6 +35,7 @@ typedef struct { · 34 unmodified lines |
| 35 | enum PixelFormat pix_fmt; | 35 | enum PixelFormat pix_fmt; |
| 36 | AVRational time_base; ///< time_base to set in the output link | 36 | AVRational time_base; ///< time_base to set in the output link |
| 37 | AVRational pixel_aspect; | 37 | AVRational pixel_aspect; |
| | 38 | char sws_param[256]; |
| 38 | } BufferSourceContext; | 39 | } BufferSourceContext; |
| 39 | | 40 | |
| 40 | int av_vsrc_buffer_add_frame2(AVFilterContext *buffer_filter, AVFrame *frame, | 41 | 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, · 12 unmodified lines |
| 53 | //return -1; | 54 | //return -1; |
| 54 | } | 55 | } |
| 55 | | 56 | |
| | 57 | if(!c->sws_param[0]){ |
| | 58 | snprintf(c->sws_param, 255, "%d:%d:%s", c->w, c->h, sws_param); |
| | 59 | } |
| | 60 | |
| 56 | if(width != c->w || height != c->h || pix_fmt != c->pix_fmt){ | 61 | if(width != c->w || height != c->h || pix_fmt != c->pix_fmt){ |
| 57 | AVFilterContext *scale= buffer_filter->outputs[0]->dst; | 62 | AVFilterContext *scale= buffer_filter->outputs[0]->dst; |
| 58 | AVFilterLink *link; | 63 | AVFilterLink *link; |
| @@ -67,7 +72,7 @@ int av_vsrc_buffer_add_frame2(AVFilterContext *buffer_filter, AVFrame *frame, · 8 unmodified lines |
| 67 | if(avfilter_open(&scale, f, "Input equalizer") < 0) | 72 | if(avfilter_open(&scale, f, "Input equalizer") < 0) |
| 68 | return -1; | 73 | return -1; |
| 69 | | 74 | |
| 70 | if((ret=avfilter_init_filter(scale, sws_param, NULL))<0){ | 75 | if((ret=avfilter_init_filter(scale, c->sws_param, NULL))<0){ |
| 71 | avfilter_free(scale); | 76 | avfilter_free(scale); |
| 72 | return ret; | 77 | return ret; |
| 73 | } | 78 | } |