[FFmpeg-cvslog] doc/examples: fix pts heuristic in filtering_video.

Clément Bœsch git at videolan.org
Sat May 19 12:32:31 CEST 2012


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Sat May 12 23:13:19 2012 +0200| [e692b9d5643bb5484c69c20162783636614bba00] | committer: Clément Bœsch

doc/examples: fix pts heuristic in filtering_video.

Note: the condition looked wrong in the first place ("if DTS is not
defined, then set PTS to that undefined value [...]").

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

 doc/examples/filtering_video.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/doc/examples/filtering_video.c b/doc/examples/filtering_video.c
index 2ca6a05..1985bc5 100644
--- a/doc/examples/filtering_video.c
+++ b/doc/examples/filtering_video.c
@@ -198,9 +198,8 @@ int main(int argc, char **argv)
             }
 
             if (got_frame) {
-                if (frame.pts == AV_NOPTS_VALUE)
-                    frame.pts = frame.pkt_dts == AV_NOPTS_VALUE ?
-                        frame.pkt_dts : frame.pkt_pts;
+                frame.pts = av_frame_get_best_effort_timestamp(&frame);
+
                 /* push the decoded frame into the filtergraph */
                 av_vsrc_buffer_add_frame(buffersrc_ctx, &frame, 0);
 



More information about the ffmpeg-cvslog mailing list