From d5c716edbd09cbb187ffec03b6855e59a6e96c11 Mon Sep 17 00:00:00 2001 From: Leif Johnson Date: Sat, 19 Jul 2003 23:17:57 +0000 Subject: + attempting to fix up playondemand ... still makes nasty crackly noises Original commit message from CVS: + attempting to fix up playondemand ... still makes nasty crackly noises --- gst/playondemand/filter.func | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'gst/playondemand/filter.func') 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); -- cgit v1.2.1