[FFmpeg-cvslog] mpegvideo: Use the current_picture pts

Michael Niedermayer git at videolan.org
Sat Sep 20 14:34:29 CEST 2014


ffmpeg | branch: release/2.2 | Michael Niedermayer <michaelni at gmx.at> | Fri Apr 18 23:11:31 2014 +0200| [051ac5c0f51c119b33a57f3e137d7344eb1c2b26] | committer: Anton Khirnov

mpegvideo: Use the current_picture pts

The picture slot can be recycled by select_input_picture and
only current_picture is populated with the valid pts.

Unbreak timestamps when in cbr mode.

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
(cherry picked from commit 1c7b71a5bdb88ebb69734100405bbb5441b871e8)
Signed-off-by: Anton Khirnov <anton at khirnov.net>

Conflicts:
	libavcodec/mpegvideo_enc.c

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

 libavcodec/mpegvideo_enc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 091bee3..dcc399f 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1663,12 +1663,12 @@ vbv_retry:
         avctx->frame_bits  = s->frame_bits;
 
         pkt->pts = s->current_picture.f.pts;
-        if (!s->low_delay) {
+        if (!s->low_delay && s->pict_type != AV_PICTURE_TYPE_B) {
             if (!s->current_picture.f.coded_picture_number)
                 pkt->dts = pkt->pts - s->dts_delta;
             else
                 pkt->dts = s->reordered_pts;
-            s->reordered_pts = s->input_picture[0]->f.pts;
+            s->reordered_pts = pkt->pts;
         } else
             pkt->dts = pkt->pts;
         if (s->current_picture.f.key_frame)



More information about the ffmpeg-cvslog mailing list