Revision ff0652e5 ffmpeg.c

View differences:

ffmpeg.c
324 324

  
325 325
#if CONFIG_AVFILTER
326 326

  
327
static int get_filtered_video_pic(AVFilterContext *ctx,
328
                                  AVFilterBufferRef **picref, AVFrame *pic2,
329
                                  uint64_t *pts)
330
{
331
    AVFilterBufferRef *pic;
332

  
333
    if(avfilter_request_frame(ctx->inputs[0]))
334
        return -1;
335
    if(!(pic = ctx->inputs[0]->cur_buf))
336
        return -1;
337
    *picref = pic;
338
    ctx->inputs[0]->cur_buf = NULL;
339

  
340
    *pts          = pic->pts;
341

  
342
    memcpy(pic2->data,     pic->data,     sizeof(pic->data));
343
    memcpy(pic2->linesize, pic->linesize, sizeof(pic->linesize));
344
    pic2->interlaced_frame = pic->video->interlaced;
345
    pic2->top_field_first  = pic->video->top_field_first;
346

  
347
    return 1;
348
}
349

  
350 327
static int configure_filters(AVInputStream *ist, AVOutputStream *ost)
351 328
{
352 329
    AVFilterContext *last_filter, *filter;
......
1600 1577
        if (start_time == 0 || ist->pts >= start_time)
1601 1578
#if CONFIG_AVFILTER
1602 1579
        while (frame_available) {
1580
            AVRational ist_pts_tb;
1603 1581
            if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && ist->output_video_filter)
1604
                get_filtered_video_pic(ist->output_video_filter, &ist->picref, &picture, &ist->pts);
1582
                get_filtered_video_frame(ist->output_video_filter, &picture, &ist->picref, &ist_pts_tb);
1583
            if (ist->picref)
1584
                ist->pts = ist->picref->pts;
1605 1585
#endif
1606 1586
            for(i=0;i<nb_ostreams;i++) {
1607 1587
                int frame_size;

Also available in: Unified diff