summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2015-10-01 19:41:56 +0200
committerAnton Khirnov <anton@khirnov.net>2015-10-16 20:00:12 +0200
commitf6f32fc93d39caf329869c1bff8ad024ccab1d42 (patch)
tree30a8207da3918abe5a1fed9af051181837284365
parent772c87c5a658f36d7c0612f5da583fc2bfa54f79 (diff)
qsvenc: set the timestamp for PIX_FMT_QSV frames as well
-rw-r--r--libavcodec/qsvenc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 7a57d441b0..71ac3ce058 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -332,10 +332,7 @@ static int submit_frame(QSVEncContext *q, const AVFrame *frame,
return ret;
qf->surface = (mfxFrameSurface1*)qf->frame->data[3];
- *surface = qf->surface;
- return 0;
- }
-
+ } else {
/* make a copy if the input is not padded as libmfx requires */
if (frame->height & 31 || frame->linesize[0] & (q->width_align - 1)) {
qf->frame->height = FFALIGN(frame->height, 32);
@@ -374,9 +371,11 @@ static int submit_frame(QSVEncContext *q, const AVFrame *frame,
qf->surface_internal.Data.PitchLow = qf->frame->linesize[0];
qf->surface_internal.Data.Y = qf->frame->data[0];
qf->surface_internal.Data.UV = qf->frame->data[1];
- qf->surface_internal.Data.TimeStamp = av_rescale_q(frame->pts, q->avctx->time_base, (AVRational){1, 90000});
qf->surface = &qf->surface_internal;
+ }
+
+ qf->surface->Data.TimeStamp = av_rescale_q(frame->pts, q->avctx->time_base, (AVRational){1, 90000});
*surface = qf->surface;