diff options
Diffstat (limited to 'gst/interleave')
-rw-r--r-- | gst/interleave/interleave.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gst/interleave/interleave.c b/gst/interleave/interleave.c index 703f69a84..8174b1a9d 100644 --- a/gst/interleave/interleave.c +++ b/gst/interleave/interleave.c @@ -1177,7 +1177,7 @@ static GstFlowReturn gst_interleave_collected (GstCollectPads * pads, GstInterleave * self) { guint size; - GstBuffer *outbuf; + GstBuffer *outbuf = NULL; GstFlowReturn ret = GST_FLOW_OK; GSList *collected; guint nsamples; @@ -1186,13 +1186,15 @@ gst_interleave_collected (GstCollectPads * pads, GstInterleave * self) gint width = self->width / 8; GstMapInfo write_info; + size = gst_collect_pads_available (pads); + if (size == 0) + goto eos; + g_return_val_if_fail (self->func != NULL, GST_FLOW_NOT_NEGOTIATED); g_return_val_if_fail (self->width > 0, GST_FLOW_NOT_NEGOTIATED); g_return_val_if_fail (self->channels > 0, GST_FLOW_NOT_NEGOTIATED); g_return_val_if_fail (self->rate > 0, GST_FLOW_NOT_NEGOTIATED); - size = gst_collect_pads_available (pads); - g_return_val_if_fail (size % width == 0, GST_FLOW_ERROR); GST_DEBUG_OBJECT (self, "Starting to collect %u bytes from %d channels", size, @@ -1281,7 +1283,8 @@ gst_interleave_collected (GstCollectPads * pads, GstInterleave * self) eos: { GST_DEBUG_OBJECT (self, "no data available, must be EOS"); - gst_buffer_unref (outbuf); + if (outbuf) + gst_buffer_unref (outbuf); gst_pad_push_event (self->src, gst_event_new_eos ()); return GST_FLOW_EOS; } |