summaryrefslogtreecommitdiff
path: root/ffmpeg.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 /ffmpeg.c
parent16b2691346fa9c3d85af3162deef3db50b1eecc5 (diff)
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 'ffmpeg.c')
-rw-r--r--ffmpeg.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 14aea7474a..e10346df95 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -324,29 +324,6 @@ static struct termios oldtty;
#if CONFIG_AVFILTER
-static int get_filtered_video_pic(AVFilterContext *ctx,
- AVFilterBufferRef **picref, AVFrame *pic2,
- uint64_t *pts)
-{
- AVFilterBufferRef *pic;
-
- if(avfilter_request_frame(ctx->inputs[0]))
- return -1;
- if(!(pic = ctx->inputs[0]->cur_buf))
- return -1;
- *picref = pic;
- ctx->inputs[0]->cur_buf = NULL;
-
- *pts = pic->pts;
-
- memcpy(pic2->data, pic->data, sizeof(pic->data));
- memcpy(pic2->linesize, pic->linesize, sizeof(pic->linesize));
- pic2->interlaced_frame = pic->video->interlaced;
- pic2->top_field_first = pic->video->top_field_first;
-
- return 1;
-}
-
static int configure_filters(AVInputStream *ist, AVOutputStream *ost)
{
AVFilterContext *last_filter, *filter;
@@ -1600,8 +1577,11 @@ static int output_packet(AVInputStream *ist, int ist_index,
if (start_time == 0 || ist->pts >= start_time)
#if CONFIG_AVFILTER
while (frame_available) {
+ AVRational ist_pts_tb;
if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && ist->output_video_filter)
- get_filtered_video_pic(ist->output_video_filter, &ist->picref, &picture, &ist->pts);
+ get_filtered_video_frame(ist->output_video_filter, &picture, &ist->picref, &ist_pts_tb);
+ if (ist->picref)
+ ist->pts = ist->picref->pts;
#endif
for(i=0;i<nb_ostreams;i++) {
int frame_size;