From: Steinar H. Gunderson Date: Tue, 22 Nov 2016 23:48:30 +0000 (+0100) Subject: Don't bother making AVPackets if x264 has no data for us. X-Git-Tag: 1.4.2~1 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=8ff7cd03f3c827602cb6603f758024cb973ea59e;p=nageru Don't bother making AVPackets if x264 has no data for us. Also gives the first SEI a more sane timestamp. --- 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();