mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-08 18:39:54 +00:00
gst/base/gstbasetransform.c: Don't leak class.
Original commit message from CVS: * gst/base/gstbasetransform.c: (gst_base_transform_class_init), (gst_base_transform_init): Don't leak class. * gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_loop): An EOS event marks the queue as completely filled.
This commit is contained in:
parent
f2e8f7198f
commit
8ce45b472d
5 changed files with 33 additions and 2 deletions
|
@ -1,3 +1,12 @@
|
|||
2005-10-28 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* gst/base/gstbasetransform.c: (gst_base_transform_class_init),
|
||||
(gst_base_transform_init):
|
||||
Don't leak class.
|
||||
|
||||
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_loop):
|
||||
An EOS event marks the queue as completely filled.
|
||||
|
||||
2005-10-27 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
|
||||
|
|
|
@ -296,7 +296,7 @@ gst_base_transform_class_init (GstBaseTransformClass * klass)
|
|||
gobject_class = G_OBJECT_CLASS (klass);
|
||||
gstelement_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
gobject_class->set_property =
|
||||
GST_DEBUG_FUNCPTR (gst_base_transform_set_property);
|
||||
|
|
|
@ -516,6 +516,7 @@ static gboolean
|
|||
gst_queue_handle_sink_event (GstPad * pad, GstEvent * event)
|
||||
{
|
||||
GstQueue *queue;
|
||||
gboolean have_eos = FALSE;
|
||||
|
||||
queue = GST_QUEUE (GST_OBJECT_PARENT (pad));
|
||||
|
||||
|
@ -557,6 +558,7 @@ gst_queue_handle_sink_event (GstPad * pad, GstEvent * event)
|
|||
goto done;
|
||||
case GST_EVENT_EOS:
|
||||
STATUS (queue, "received EOS");
|
||||
have_eos = TRUE;
|
||||
break;
|
||||
default:
|
||||
if (GST_EVENT_IS_SERIALIZED (event)) {
|
||||
|
@ -571,6 +573,12 @@ gst_queue_handle_sink_event (GstPad * pad, GstEvent * event)
|
|||
}
|
||||
|
||||
GST_QUEUE_MUTEX_LOCK (queue);
|
||||
if (have_eos) {
|
||||
/* FIXME, abusing the cur_level */
|
||||
queue->cur_level.buffers = queue->max_size.buffers;
|
||||
queue->cur_level.bytes = queue->max_size.bytes;
|
||||
queue->cur_level.time = queue->max_size.time;
|
||||
}
|
||||
g_queue_push_tail (queue->queue, event);
|
||||
g_cond_signal (queue->item_add);
|
||||
GST_QUEUE_MUTEX_UNLOCK (queue);
|
||||
|
@ -822,6 +830,9 @@ restart:
|
|||
}
|
||||
} else {
|
||||
if (GST_EVENT_TYPE (data) == GST_EVENT_EOS) {
|
||||
queue->cur_level.buffers = 0;
|
||||
queue->cur_level.bytes = 0;
|
||||
queue->cur_level.time = 0;
|
||||
/* all incomming data is now unexpected */
|
||||
queue->srcresult = GST_FLOW_UNEXPECTED;
|
||||
/* and we don't need to process anymore */
|
||||
|
|
|
@ -296,7 +296,7 @@ gst_base_transform_class_init (GstBaseTransformClass * klass)
|
|||
gobject_class = G_OBJECT_CLASS (klass);
|
||||
gstelement_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
gobject_class->set_property =
|
||||
GST_DEBUG_FUNCPTR (gst_base_transform_set_property);
|
||||
|
|
|
@ -516,6 +516,7 @@ static gboolean
|
|||
gst_queue_handle_sink_event (GstPad * pad, GstEvent * event)
|
||||
{
|
||||
GstQueue *queue;
|
||||
gboolean have_eos = FALSE;
|
||||
|
||||
queue = GST_QUEUE (GST_OBJECT_PARENT (pad));
|
||||
|
||||
|
@ -557,6 +558,7 @@ gst_queue_handle_sink_event (GstPad * pad, GstEvent * event)
|
|||
goto done;
|
||||
case GST_EVENT_EOS:
|
||||
STATUS (queue, "received EOS");
|
||||
have_eos = TRUE;
|
||||
break;
|
||||
default:
|
||||
if (GST_EVENT_IS_SERIALIZED (event)) {
|
||||
|
@ -571,6 +573,12 @@ gst_queue_handle_sink_event (GstPad * pad, GstEvent * event)
|
|||
}
|
||||
|
||||
GST_QUEUE_MUTEX_LOCK (queue);
|
||||
if (have_eos) {
|
||||
/* FIXME, abusing the cur_level */
|
||||
queue->cur_level.buffers = queue->max_size.buffers;
|
||||
queue->cur_level.bytes = queue->max_size.bytes;
|
||||
queue->cur_level.time = queue->max_size.time;
|
||||
}
|
||||
g_queue_push_tail (queue->queue, event);
|
||||
g_cond_signal (queue->item_add);
|
||||
GST_QUEUE_MUTEX_UNLOCK (queue);
|
||||
|
@ -822,6 +830,9 @@ restart:
|
|||
}
|
||||
} else {
|
||||
if (GST_EVENT_TYPE (data) == GST_EVENT_EOS) {
|
||||
queue->cur_level.buffers = 0;
|
||||
queue->cur_level.bytes = 0;
|
||||
queue->cur_level.time = 0;
|
||||
/* all incomming data is now unexpected */
|
||||
queue->srcresult = GST_FLOW_UNEXPECTED;
|
||||
/* and we don't need to process anymore */
|
||||
|
|
Loading…
Reference in a new issue