avcodec/libx264: add a check for the prft AVCodecContext export_side_data flag
authorJames Almer <jamrial@gmail.com>
Wed, 29 Jan 2020 14:12:18 +0000 (11:12 -0300)
committerJames Almer <jamrial@gmail.com>
Sun, 23 Feb 2020 02:19:07 +0000 (23:19 -0300)
Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/libx264.c

index ca8f6c0..a08fe0c 100644 (file)
@@ -322,7 +322,9 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
         x4->pic.i_pts  = frame->pts;
 
         x4->reordered_opaque[x4->next_reordered_opaque].reordered_opaque = frame->reordered_opaque;
-        x4->reordered_opaque[x4->next_reordered_opaque].wallclock = av_gettime();
+        x4->reordered_opaque[x4->next_reordered_opaque].wallclock = wallclock;
+        if (ctx->export_side_data & AV_CODEC_EXPORT_DATA_PRFT)
+            x4->reordered_opaque[x4->next_reordered_opaque].wallclock = av_gettime();
         x4->pic.opaque = &x4->reordered_opaque[x4->next_reordered_opaque];
         x4->next_reordered_opaque++;
         x4->next_reordered_opaque %= x4->nb_reordered_opaque;