audioencoder: only got_data if we really got some
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Tue, 27 Sep 2011 14:18:05 +0000 (16:18 +0200)
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Tue, 27 Sep 2011 14:58:44 +0000 (16:58 +0200)
... which avoids going loopy with casual subclass.

gst-libs/gst/audio/gstaudioencoder.c

index 7c4ab4a..1a8887e 100644 (file)
@@ -494,7 +494,8 @@ gst_audio_encoder_finish_frame (GstAudioEncoder * enc, GstBuffer * buf,
       buf ? GST_BUFFER_SIZE (buf) : -1, samples);
 
   /* mark subclass still alive and providing */
-  priv->got_data = TRUE;
+  if (G_LIKELY (buf))
+    priv->got_data = TRUE;
 
   if (priv->pending_events) {
     GList *pending_events, *l;