From 8ff7cd03f3c827602cb6603f758024cb973ea59e Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Wed, 23 Nov 2016 00:48:30 +0100 Subject: [PATCH] Don't bother making AVPackets if x264 has no data for us. Also gives the first SEI a more sane timestamp. --- x264_encoder.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x264_encoder.cpp b/x264_encoder.cpp index f909f55..6006e0e 100644 --- a/x264_encoder.cpp +++ b/x264_encoder.cpp @@ -278,6 +278,8 @@ void X264Encoder::encode_frame(X264Encoder::QueuedFrame qf) speed_control->after_frame(); } + if (num_nal == 0) return; + // We really need one AVPacket for the entire frame, it seems, // so combine it all. size_t num_bytes = buffered_sei.size(); -- 2.39.2