Revision ff0652e5 ffplay.c

View differences:

ffplay.c
1779 1779
                                  { .name = NULL }},
1780 1780
};
1781 1781

  
1782
static int get_filtered_video_frame(AVFilterContext *ctx, AVFrame *frame,
1783
                                    int64_t *pts, AVRational *tb, int64_t *pos)
1784
{
1785
    AVFilterBufferRef *pic;
1786

  
1787
    if(avfilter_request_frame(ctx->inputs[0]))
1788
        return -1;
1789
    if(!(pic = ctx->inputs[0]->cur_buf))
1790
        return -1;
1791
    ctx->inputs[0]->cur_buf = NULL;
1792

  
1793
    frame->opaque = pic;
1794
    *pts          = pic->pts;
1795
    *pos          = pic->pos;
1796
    *tb           = ctx->inputs[0]->time_base;
1797

  
1798
    memcpy(frame->data,     pic->data,     sizeof(frame->data));
1799
    memcpy(frame->linesize, pic->linesize, sizeof(frame->linesize));
1800

  
1801
    return 1;
1802
}
1803 1782
#endif  /* CONFIG_AVFILTER */
1804 1783

  
1805 1784
static int video_thread(void *arg)
......
1859 1838
#if !CONFIG_AVFILTER
1860 1839
        AVPacket pkt;
1861 1840
#else
1841
        AVFilterBufferRef *picref;
1862 1842
        AVRational tb;
1863 1843
#endif
1864 1844
        while (is->paused && !is->videoq.abort_request)
1865 1845
            SDL_Delay(10);
1866 1846
#if CONFIG_AVFILTER
1867
        ret = get_filtered_video_frame(filt_out, frame, &pts_int, &tb, &pos);
1847
        ret = get_filtered_video_frame(filt_out, frame, &picref, &tb);
1848
        if (picref) {
1849
            pts_int = picref->pts;
1850
            pos     = picref->pos;
1851
            frame->opaque = picref;
1852
        }
1868 1853

  
1869 1854
        if (av_cmp_q(tb, is->video_st->time_base)) {
1870 1855
            int64_t pts1 = pts_int;

Also available in: Unified diff