Otherwise we are likely to crash if EOS didn't happen yet.
https://bugzilla.gnome.org/show_bug.cgi?id=781410
static void gst_nv_base_enc_finalize (GObject * obj);
static GstCaps *gst_nv_base_enc_getcaps (GstVideoEncoder * enc,
GstCaps * filter);
+static gboolean gst_nv_base_enc_stop_bitstream_thread (GstNvBaseEnc * nvenc);
static void
gst_nv_base_enc_class_init (GstNvBaseEncClass * klass)
{
GstNvBaseEnc *nvenc = GST_NV_BASE_ENC (enc);
+ gst_nv_base_enc_stop_bitstream_thread (nvenc);
+
gst_nv_base_enc_free_buffers (nvenc);
if (nvenc->bitstream_pool) {