[FFmpeg-cvslog] ffmpeg: affect computed filtered frame pts after filling frame from buffer

Matthieu Bouron git at videolan.org
Mon May 14 23:43:55 CEST 2012


ffmpeg | branch: master | Matthieu Bouron <matthieu.bouron at smartjog.com> | Mon May 14 15:10:23 2012 +0200| [4c73b3b1e07f0d91bcca33d7555ca570f2f3a394] | committer: Michael Niedermayer

ffmpeg: affect computed filtered frame pts after filling frame from buffer

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4c73b3b1e07f0d91bcca33d7555ca570f2f3a394
---

 ffmpeg.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index fa2c444..801ce2f 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2114,6 +2114,7 @@ static int poll_filters(void)
     AVFrame *filtered_frame = NULL;
     int i, ret, ret_all;
     unsigned nb_success, nb_eof;
+    int64_t frame_pts;
 
     while (1) {
         /* Reap all buffers present in the buffer sinks */
@@ -2143,7 +2144,7 @@ static int poll_filters(void)
                     }
                     break;
                 }
-                filtered_frame->pts = av_rescale_q(picref->pts, ist_pts_tb, AV_TIME_BASE_Q);
+                filtered_frame->pts = frame_pts = av_rescale_q(picref->pts, ist_pts_tb, AV_TIME_BASE_Q);
                 //if (ost->source_index >= 0)
                 //    *filtered_frame= *input_streams[ost->source_index]->decoded_frame; //for me_threshold
 
@@ -2153,6 +2154,7 @@ static int poll_filters(void)
                 switch (ost->filter->filter->inputs[0]->type) {
                 case AVMEDIA_TYPE_VIDEO:
                     avfilter_fill_frame_from_video_buffer_ref(filtered_frame, picref);
+                    filtered_frame->pts = frame_pts;
                     if (!ost->frame_aspect_ratio)
                         ost->st->codec->sample_aspect_ratio = picref->video->sample_aspect_ratio;
 



More information about the ffmpeg-cvslog mailing list