Revision 79b90b25 ffmpeg.c

View differences:

ffmpeg.c
406 406

  
407 407
    graph = av_mallocz(sizeof(AVFilterGraph));
408 408

  
409
    if(!(ist->input_video_filter = avfilter_open(avfilter_get_by_name("buffer"), "src")))
409
    if (!(ist->input_video_filter = avfilter_open(avfilter_get_by_name("buffer"), "src")))
410 410
        return -1;
411
    if(!(ist->out_video_filter = avfilter_open(&output_filter, "out")))
411
    if (!(ist->out_video_filter = avfilter_open(&output_filter, "out")))
412 412
        return -1;
413 413

  
414 414
    snprintf(args, 255, "%d:%d:%d", ist->st->codec->width,
415 415
             ist->st->codec->height, ist->st->codec->pix_fmt);
416
    if(avfilter_init_filter(ist->input_video_filter, args, NULL))
416
    if (avfilter_init_filter(ist->input_video_filter, args, NULL))
417 417
        return -1;
418
    if(avfilter_init_filter(ist->out_video_filter, NULL, &codec->pix_fmt))
418
    if (avfilter_init_filter(ist->out_video_filter, NULL, &codec->pix_fmt))
419 419
        return -1;
420 420

  
421 421
    /* add input and output filters to the overall graph */
......
424 424

  
425 425
    curr_filter = ist->input_video_filter;
426 426

  
427
    if(ost->video_crop) {
427
    if (ost->video_crop) {
428 428
        AVFilterContext *filt_crop;
429 429
        snprintf(args, 255, "%d:%d:%d:%d", ost->leftBand, ost->topBand,
430 430
                 codec->width,
......
459 459
        avfilter_graph_add_filter(graph, curr_filter);
460 460
    }
461 461

  
462
    if(vfilters) {
462
    if (vfilters) {
463 463
        AVFilterInOut *outputs = av_malloc(sizeof(AVFilterInOut));
464 464
        AVFilterInOut *inputs  = av_malloc(sizeof(AVFilterInOut));
465 465

  
......
477 477
            return -1;
478 478
        av_freep(&vfilters);
479 479
    } else {
480
        if(avfilter_link(curr_filter, 0, ist->out_video_filter, 0) < 0)
480
        if (avfilter_link(curr_filter, 0, ist->out_video_filter, 0) < 0)
481 481
            return -1;
482 482
    }
483 483

  
484
        snprintf(args, sizeof(args), "flags=0x%X", (int)av_get_int(sws_opts, "sws_flags", NULL));
485
        graph->scale_sws_opts = av_strdup(args);
484
    snprintf(args, sizeof(args), "flags=0x%X", (int)av_get_int(sws_opts, "sws_flags", NULL));
485
    graph->scale_sws_opts = av_strdup(args);
486 486

  
487 487
    /* configure all the filter links */
488
    if(avfilter_graph_check_validity(graph, NULL))
488
    if (avfilter_graph_check_validity(graph, NULL))
489 489
        return -1;
490
    if(avfilter_graph_config_formats(graph, NULL))
490
    if (avfilter_graph_config_formats(graph, NULL))
491 491
        return -1;
492
    if(avfilter_graph_config_links(graph, NULL))
492
    if (avfilter_graph_config_links(graph, NULL))
493 493
        return -1;
494 494

  
495 495
    codec->width = ist->out_video_filter->inputs[0]->w;

Also available in: Unified diff