summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-11-02 18:40:59 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-11-02 18:40:59 +0000
commitda1b9b88a558357361c09cbe0656ce7387dc2e4f (patch)
tree92c7bad885b19d2516087f4371a209b7c9a391c3
parent4b3d0dc6430ee8a056d632a72f288486c7238fd8 (diff)
Fix timestamp computation when the timebase changes during filtering.
The timestamps for all the buffered frames are scaled against AV_TIME_BASE_Q, and need to be scaled back to AV_TIME_BASE_Q when they are extracted from the filterchain. Originally committed as revision 25646 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--ffmpeg.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index fd3b404a33..4d1b75416c 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -352,8 +352,7 @@ static int configure_filters(AVInputStream *ist, AVOutputStream *ost)
return ret;
snprintf(args, 255, "%d:%d:%d:%d:%d", ist->st->codec->width,
- ist->st->codec->height, ist->st->codec->pix_fmt,
- ist->st->time_base.num, ist->st->time_base.den);
+ ist->st->codec->height, ist->st->codec->pix_fmt, 1, AV_TIME_BASE);
if ((ret = avfilter_init_filter(ist->input_video_filter, args, NULL)) < 0)
return ret;
if ((ret = avfilter_init_filter(ist->output_video_filter, NULL, &ffsink_ctx)) < 0)
@@ -1618,7 +1617,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && ist->output_video_filter)
get_filtered_video_frame(ist->output_video_filter, &picture, &ist->picref, &ist_pts_tb);
if (ist->picref)
- ist->pts = ist->picref->pts;
+ ist->pts = av_rescale_q(ist->picref->pts, ist_pts_tb, AV_TIME_BASE_Q);
#endif
for(i=0;i<nb_ostreams;i++) {
int frame_size;