aboutsummaryrefslogtreecommitdiffstats
path: root/ffplay.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-10-18 13:57:11 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-10-18 13:57:11 +0000
commitff0652e5036fd30cf518891d2158acbafea191fc (patch)
tree24a25a1e2590b68d096ebb2312aa1d8291be87e8 /ffplay.c
parent16b2691346fa9c3d85af3162deef3db50b1eecc5 (diff)
downloadffmpeg-ff0652e5036fd30cf518891d2158acbafea191fc.tar.gz
Implement a common get_filtered_video_frame(), shared between ffplay.c
and ffmpeg.c. Originally committed as revision 25520 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/ffplay.c b/ffplay.c
index da12810d18..eecf16a14f 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1779,27 +1779,6 @@ static AVFilter input_filter =
{ .name = NULL }},
};
-static int get_filtered_video_frame(AVFilterContext *ctx, AVFrame *frame,
- int64_t *pts, AVRational *tb, int64_t *pos)
-{
- AVFilterBufferRef *pic;
-
- if(avfilter_request_frame(ctx->inputs[0]))
- return -1;
- if(!(pic = ctx->inputs[0]->cur_buf))
- return -1;
- ctx->inputs[0]->cur_buf = NULL;
-
- frame->opaque = pic;
- *pts = pic->pts;
- *pos = pic->pos;
- *tb = ctx->inputs[0]->time_base;
-
- memcpy(frame->data, pic->data, sizeof(frame->data));
- memcpy(frame->linesize, pic->linesize, sizeof(frame->linesize));
-
- return 1;
-}
#endif /* CONFIG_AVFILTER */
static int video_thread(void *arg)
@@ -1859,12 +1838,18 @@ static int video_thread(void *arg)
#if !CONFIG_AVFILTER
AVPacket pkt;
#else
+ AVFilterBufferRef *picref;
AVRational tb;
#endif
while (is->paused && !is->videoq.abort_request)
SDL_Delay(10);
#if CONFIG_AVFILTER
- ret = get_filtered_video_frame(filt_out, frame, &pts_int, &tb, &pos);
+ ret = get_filtered_video_frame(filt_out, frame, &picref, &tb);
+ if (picref) {
+ pts_int = picref->pts;
+ pos = picref->pos;
+ frame->opaque = picref;
+ }
if (av_cmp_q(tb, is->video_st->time_base)) {
int64_t pts1 = pts_int;