Revision b0f65613 libavfilter/vf_yadif.c

View differences:

libavfilter/vf_yadif.c
164 164
    return picref;
165 165
}
166 166

  
167
static void return_frame(AVFilterContext *ctx, int is_second){
167
static void return_frame(AVFilterContext *ctx, int is_second)
168
{
168 169
    YADIFContext *yadif = ctx->priv;
169 170
    AVFilterLink *link= ctx->outputs[0];
170 171
    int tff = yadif->parity == -1 ? yadif->cur->video->top_field_first : (yadif->parity^1);
171 172

  
172
    if(is_second)
173
    if (is_second)
173 174
        yadif->out = avfilter_get_video_buffer(link, AV_PERM_WRITE | AV_PERM_PRESERVE |
174
                                       AV_PERM_REUSE, link->w, link->h);
175
                                               AV_PERM_REUSE, link->w, link->h);
175 176

  
176 177
    filter(ctx, yadif->out, tff ^ !is_second, tff);
177 178

  
178
    if(is_second)
179
    if (is_second)
179 180
        avfilter_start_frame(ctx->outputs[0], yadif->out);
180 181
    avfilter_draw_slice(ctx->outputs[0], 0, link->h, 1);
181 182
    avfilter_end_frame(ctx->outputs[0]);
182 183

  
183
    yadif->frame_pending= (yadif->mode&1) && !is_second;
184
    yadif->frame_pending = (yadif->mode&1) && !is_second;
184 185
}
185 186

  
186 187
static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
......
188 189
    AVFilterContext *ctx = link->dst;
189 190
    YADIFContext *yadif = ctx->priv;
190 191

  
191
    if(yadif->frame_pending)
192
    if (yadif->frame_pending)
192 193
        return_frame(ctx, 1);
193 194

  
194 195
    if (yadif->prev)
......
197 198
    yadif->cur  = yadif->next;
198 199
    yadif->next = picref;
199 200

  
200
    if(!yadif->cur)
201
    if (!yadif->cur)
201 202
        return;
202 203

  
203 204
    if (!yadif->prev)
......
215 216
    AVFilterContext *ctx = link->dst;
216 217
    YADIFContext *yadif = ctx->priv;
217 218

  
218
    if(!yadif->out)
219
    if (!yadif->out)
219 220
        return;
220 221

  
221 222
    return_frame(ctx, 0);
......
226 227
    AVFilterContext *ctx = link->src;
227 228
    YADIFContext *yadif = ctx->priv;
228 229

  
229
    if(yadif->frame_pending){
230
    if (yadif->frame_pending) {
230 231
        return_frame(ctx, 1);
231 232
        return 0;
232 233
    }
233 234

  
234
    do{
235
    do {
235 236
        int ret;
236 237

  
237 238
        if ((ret = avfilter_request_frame(link->src->inputs[0])))
238 239
            return ret;
239
    }while(!yadif->cur);
240
    } while (!yadif->cur);
240 241

  
241 242
    return 0;
242 243
}
......
246 247
    YADIFContext *yadif = link->src->priv;
247 248
    int ret, val;
248 249

  
249
    if(yadif->frame_pending)
250
    if (yadif->frame_pending)
250 251
        return 1;
251 252

  
252
    val= avfilter_poll_frame(link->src->inputs[0]);
253
    val = avfilter_poll_frame(link->src->inputs[0]);
253 254

  
254
    if(val==1 && !yadif->next){ //FIXME change API to not requre this red tape
255
    if (val==1 && !yadif->next) { //FIXME change API to not requre this red tape
255 256
        if ((ret = avfilter_request_frame(link->src->inputs[0])) < 0)
256 257
            return ret;
257 258
        val = avfilter_poll_frame(link->src->inputs[0]);

Also available in: Unified diff