Revision 69818105 libavfilter/avfilter.c

View differences:

libavfilter/avfilter.c
125 125
    return 0;
126 126
}
127 127

  
128
int avfilter_config_link(AVFilterLink *link)
128
int avfilter_config_links(AVFilterContext *filter)
129 129
{
130 130
    int (*config_link)(AVFilterLink *);
131
    unsigned i;
131 132

  
132
    if(!link)
133
        return 0;
133
    for(i = 0; i < filter->input_count; i ++) {
134
        AVFilterLink *link;
135

  
136
        if(!(link = filter->inputs[i])) continue;
137

  
138
        switch(link->init_state) {
139
        case AVLINK_INIT:
140
            continue;
141
        case AVLINK_STARTINIT:
142
            av_log(filter, AV_LOG_ERROR, "circular filter chain detected\n");
143
            return -1;
144
        case AVLINK_UNINIT:
145
            link->init_state = AVLINK_STARTINIT;
146

  
147
            if(avfilter_config_links(link->src))
148
                return -1;
134 149

  
135 150
    if(!(config_link = link_spad(link).config_props))
136 151
        config_link  = avfilter_default_config_output_link;
137 152
    if(config_link(link))
138 153
            return -1;
139 154

  
140
    if(!(config_link = link_dpad(link).config_props))
141
        config_link  = avfilter_default_config_input_link;
155
    if((config_link = link_dpad(link).config_props))
142 156
    if(config_link(link))
143 157
            return -1;
144 158

  
159
            link->init_state = AVLINK_INIT;
160
        }
161
    }
162

  
145 163
    return 0;
146 164
}
147 165

  

Also available in: Unified diff