diff mbox series

[FFmpeg-devel,2/2] avcodec/libx264: add a check for the export_prft AVCodecContext flag

Message ID 20200123202535.232-2-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/2] avcodec: add an AVCodecContext flag to export PRFT side data on demand
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

James Almer Jan. 23, 2020, 8:25 p.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/libx264.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index ca8f6c0873..7cb716e13d 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -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->flags2 & AV_CODEC_FLAG2_EXPORT_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;