From 201c4a698e2819806aa27a438f4bc9d315a3bdb3 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sun, 20 Oct 2002 17:27:51 +0000 Subject: [PATCH] Don't push on unusable pads Original commit message from CVS: Don't push on unusable pads --- ext/vorbis/vorbisenc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ext/vorbis/vorbisenc.c b/ext/vorbis/vorbisenc.c index 59f599c4e9..854a60c5e8 100644 --- a/ext/vorbis/vorbisenc.c +++ b/ext/vorbis/vorbisenc.c @@ -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) */