From 3bb984987ccfb877a30d2e2daceb1f4c0a618178 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= <Reimar.Doeffinger@gmx.de>
Date: Sat, 10 Oct 2009 14:43:31 +0000
Subject: [PATCH] Hack: set the coded frame PTS to the incoming PTS. This is
 not correct, but libtheora does not seem to provide a way to get the correct
 value, and this is necessary to make encoding produce sensible time stamps
 when encoded content is variable FPS or the time base is simply different
 from FPS. Somewhat fixes issue 1197.

Originally committed as revision 20199 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavcodec/libtheoraenc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c
index f0285956dad..fb05e5a3d13 100644
--- a/libavcodec/libtheoraenc.c
+++ b/libavcodec/libtheoraenc.c
@@ -250,6 +250,9 @@ static int encode_frame(
     }
     memcpy(outbuf, o_packet.packet, o_packet.bytes);
 
+    // HACK: does not take codec delay into account (neither does the decoder though)
+    avc_context->coded_frame->pts= frame->pts;
+
     return o_packet.bytes;
 }
 
-- 
GitLab