Browse code

qsvenc: set the timestamp for PIX_FMT_QSV frames as well

Anton Khirnov authored on 2015/10/02 02:41:56
Showing 1 changed files
... ...
@@ -332,10 +332,7 @@ static int submit_frame(QSVEncContext *q, const AVFrame *frame,
332 332
             return ret;
333 333
 
334 334
         qf->surface = (mfxFrameSurface1*)qf->frame->data[3];
335
-        *surface = qf->surface;
336
-        return 0;
337
-    }
338
-
335
+    } else {
339 336
     /* make a copy if the input is not padded as libmfx requires */
340 337
     if (frame->height & 31 || frame->linesize[0] & (q->width_align - 1)) {
341 338
         qf->frame->height = FFALIGN(frame->height, 32);
... ...
@@ -374,9 +371,11 @@ static int submit_frame(QSVEncContext *q, const AVFrame *frame,
374 374
     qf->surface_internal.Data.PitchLow  = qf->frame->linesize[0];
375 375
     qf->surface_internal.Data.Y         = qf->frame->data[0];
376 376
     qf->surface_internal.Data.UV        = qf->frame->data[1];
377
-    qf->surface_internal.Data.TimeStamp = av_rescale_q(frame->pts, q->avctx->time_base, (AVRational){1, 90000});
378 377
 
379 378
     qf->surface = &qf->surface_internal;
379
+    }
380
+
381
+    qf->surface->Data.TimeStamp = av_rescale_q(frame->pts, q->avctx->time_base, (AVRational){1, 90000});
380 382
 
381 383
     *surface = qf->surface;
382 384