]> git.sesse.net Git - nageru/commitdiff
Don't bother making AVPackets if x264 has no data for us.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 22 Nov 2016 23:48:30 +0000 (00:48 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 22 Nov 2016 23:53:10 +0000 (00:53 +0100)
Also gives the first SEI a more sane timestamp.

x264_encoder.cpp

index f909f55e555bea9ee3369b62ad8509f207c324ee..6006e0e6843b0c32204411c4681d89edef754e25 100644 (file)
@@ -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();