summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-18 23:11:31 +0200
committerLuca Barbato <lu_zero@gentoo.org>2014-04-21 21:58:58 +0200
commit1c7b71a5bdb88ebb69734100405bbb5441b871e8 (patch)
tree2e80fdd2065af3cb608df608abea72e6b977d0a7
parent6f243b17c537646b894857d43dfdac65f85ab377 (diff)
downloadffmpeg-streaming-1c7b71a5bdb88ebb69734100405bbb5441b871e8.zip
ffmpeg-streaming-1c7b71a5bdb88ebb69734100405bbb5441b871e8.tar.gz
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@gentoo.org>
-rw-r--r--libavcodec/mpegvideo_enc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 4e72a25..9c2b24b 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1664,12 +1664,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)
OpenPOWER on IntegriCloud