Revision e675dccd

View differences:

libavfilter/avfilter.c
97 97
{
98 98
    int *fmts[2], i, j;
99 99
    int (*config_link)(AVFilterLink *);
100
    int *(*query_formats)(AVFilterLink *link);
100 101

  
101 102
    if(!link)
102 103
        return 0;
103 104

  
104 105
    /* find a format both filters support - TODO: auto-insert conversion filter */
105 106
    link->format = -1;
106
    if(link_spad(link).query_formats)
107
        fmts[0] = link_spad(link).query_formats(link);
108
    else
109
        fmts[0] = avfilter_default_query_output_formats(link);
107
    if(!(query_formats = link_spad(link).query_formats))
108
        query_formats = avfilter_default_query_output_formats;
109
    fmts[0] = query_formats(link);
110 110
    fmts[1] = link_dpad(link).query_formats(link);
111 111
    for(i = 0; fmts[0][i] != -1; i ++)
112 112
        for(j = 0; fmts[1][j] != -1; j ++)
......
162 162
{
163 163
    void (*start_frame)(AVFilterLink *, AVFilterPicRef *);
164 164

  
165
    start_frame = link_dpad(link).start_frame;
166
    if(!start_frame)
165
    if(!(start_frame = link_dpad(link).start_frame))
167 166
        start_frame = avfilter_default_start_frame;
168 167

  
169 168
    /* prepare to copy the picture if it has insufficient permissions */
......
194 193
        link->srcpic = NULL;
195 194
    }
196 195

  
197
    end_frame = link_dpad(link).end_frame;
198
    if(!end_frame)
196
    if(!(end_frame = link_dpad(link).end_frame))
199 197
        end_frame = avfilter_default_end_frame;
200 198

  
201 199
    end_frame(link);

Also available in: Unified diff