Don't push on unusable pads

Original commit message from CVS:
Don't push on unusable pads
This commit is contained in:
Wim Taymans 2002-10-20 17:27:51 +00:00
parent 9eb2541f75
commit 201c4a698e

View file

@ -736,6 +736,7 @@ gst_vorbisenc_chain (GstPad * pad, GstBuffer * buf)
if (result == 0)
break;
outbuf = gst_buffer_new_and_alloc (vorbisenc->og.header_len +
vorbisenc->og.body_len);
@ -750,7 +751,12 @@ gst_vorbisenc_chain (GstPad * pad, GstBuffer * buf)
vorbisenc->bytes_out += GST_BUFFER_SIZE (outbuf);
gst_pad_push (vorbisenc->srcpad, outbuf);
if (GST_PAD_IS_USABLE (vorbisenc->srcpad)) {
gst_pad_push (vorbisenc->srcpad, outbuf);
}
else {
gst_buffer_unref (outbuf);
}
/* this could be set above, but for illustrative purposes, I do
it here (to show that vorbis does know where the stream ends) */