summaryrefslogtreecommitdiffstats
path: root/gst/playondemand/filter.func
diff options
context:
space:
mode:
Diffstat (limited to 'gst/playondemand/filter.func')
-rw-r--r--gst/playondemand/filter.func13
1 files changed, 7 insertions, 6 deletions
diff --git a/gst/playondemand/filter.func b/gst/playondemand/filter.func
index 61c1cc56..7c9f4de7 100644
--- a/gst/playondemand/filter.func
+++ b/gst/playondemand/filter.func
@@ -6,22 +6,23 @@ filter_data = (_TYPE_ *) filter->buffer;
num_filter = filter->buffer_bytes / sizeof(_TYPE_);
do {
+ if (in == NULL && ! filter->eos) in = gst_pad_pull(filter->sinkpad);
+
/****************************************************************************/
/* see if we've got any events coming through ... */
while (! filter->eos && GST_IS_EVENT(in)) {
if (GST_EVENT_TYPE(in) == GST_EVENT_EOS) {
gst_event_unref(in);
+ gst_buffer_free(in);
filter->eos = TRUE;
} else if ((GST_EVENT_TYPE(in) == GST_EVENT_SEEK) ||
(GST_EVENT_TYPE(in) == GST_EVENT_FLUSH)) {
+ gst_event_unref(in);
+ gst_buffer_free(in);
filter->eos = FALSE;
filter->write = 0;
} else {
- if ((GST_EVENT_TYPE(in) == GST_EVENT_SEEK) ||
- (GST_EVENT_TYPE(in) == GST_EVENT_FLUSH))
- filter->write = 0;
-
gst_pad_push(filter->srcpad, in);
}
@@ -49,6 +50,8 @@ do {
out = gst_buffer_new_from_pool(filter->bufpool, 0, 0);
}
+ in = NULL;
+
/****************************************************************************/
/* check to see if we have to add new play pointers. */
@@ -113,8 +116,6 @@ do {
gst_pad_push(filter->srcpad, out);
- in = (! filter->eos) ? gst_pad_pull(filter->sinkpad) : NULL;
-
if (gst_element_interrupt (GST_ELEMENT (filter))) break;
} while (TRUE);