Originally committed as revision 17547 to svn://svn.ffmpeg.org/ffmpeg/trunk
Showing the changes to libavfilter/avfiltergraph.c (1 of 3 files). Show all
Unified · Split
| @@ -30,6 +30,7 @@ void avfilter_destroy_graph(AVFilterGraph *graph) · 29 unmodified lines | ||
| 30 | 30 | { |
| 31 | 31 | for(; graph->filter_count > 0; graph->filter_count --) |
| 32 | 32 | avfilter_destroy(graph->filters[graph->filter_count - 1]); |
| 33 | + av_freep(&graph->scale_sws_opts); | |
| 33 | 34 | av_freep(&graph->filters); |
| 34 | 35 | } |
| 35 | 36 | |
| @@ -111,13 +112,15 @@ static int query_formats(AVFilterGraph *graph) · 75 unmodified lines | ||
| 111 | 112 | if(!avfilter_merge_formats(link->in_formats, |
| 112 | 113 | link->out_formats)) { |
| 113 | 114 | AVFilterContext *scale; |
| 115 | + char scale_args[256]; | |
| 114 | 116 | /* couldn't merge format lists. auto-insert scale filter */ |
| 115 | 117 | snprintf(inst_name, sizeof(inst_name), "auto-inserted scaler %d", |
| 116 | 118 | scaler_count); |
| 117 | 119 | scale = |
| 118 | 120 | avfilter_open(avfilter_get_by_name("scale"),inst_name); |
| 119 | 121 | |
| 120 | − if(!scale || scale->filter->init(scale, NULL, NULL) || | |
| 122 | + snprintf(scale_args, sizeof(scale_args), "0:0:%s", graph->scale_sws_opts); | |
| 123 | + if(!scale || scale->filter->init(scale, scale_args, NULL) || | |
| 121 | 124 | avfilter_insert_filter(link, scale, 0, 0)) { |
| 122 | 125 | avfilter_destroy(scale); |
| 123 | 126 | return -1; |