mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
aggregator: Reset pad on init
Factor out the pad reset code from the flushing and use it on init as well https://bugzilla.gnome.org/show_bug.cgi?id=781673
This commit is contained in:
parent
06bc00ec98
commit
b7693464d0
1 changed files with 13 additions and 5 deletions
|
@ -229,12 +229,10 @@ struct _GstAggregatorPadPrivate
|
||||||
GMutex flush_lock;
|
GMutex flush_lock;
|
||||||
};
|
};
|
||||||
|
|
||||||
static gboolean
|
/* Must be called with PAD_LOCK held */
|
||||||
gst_aggregator_pad_flush (GstAggregatorPad * aggpad, GstAggregator * agg)
|
static void
|
||||||
|
gst_aggregator_pad_reset_unlocked (GstAggregatorPad * aggpad)
|
||||||
{
|
{
|
||||||
GstAggregatorPadClass *klass = GST_AGGREGATOR_PAD_GET_CLASS (aggpad);
|
|
||||||
|
|
||||||
PAD_LOCK (aggpad);
|
|
||||||
aggpad->priv->pending_eos = FALSE;
|
aggpad->priv->pending_eos = FALSE;
|
||||||
aggpad->priv->eos = FALSE;
|
aggpad->priv->eos = FALSE;
|
||||||
aggpad->priv->flow_return = GST_FLOW_OK;
|
aggpad->priv->flow_return = GST_FLOW_OK;
|
||||||
|
@ -247,6 +245,15 @@ gst_aggregator_pad_flush (GstAggregatorPad * aggpad, GstAggregator * agg)
|
||||||
aggpad->priv->head_time = GST_CLOCK_TIME_NONE;
|
aggpad->priv->head_time = GST_CLOCK_TIME_NONE;
|
||||||
aggpad->priv->tail_time = GST_CLOCK_TIME_NONE;
|
aggpad->priv->tail_time = GST_CLOCK_TIME_NONE;
|
||||||
aggpad->priv->time_level = 0;
|
aggpad->priv->time_level = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
gst_aggregator_pad_flush (GstAggregatorPad * aggpad, GstAggregator * agg)
|
||||||
|
{
|
||||||
|
GstAggregatorPadClass *klass = GST_AGGREGATOR_PAD_GET_CLASS (aggpad);
|
||||||
|
|
||||||
|
PAD_LOCK (aggpad);
|
||||||
|
gst_aggregator_pad_reset_unlocked (aggpad);
|
||||||
PAD_UNLOCK (aggpad);
|
PAD_UNLOCK (aggpad);
|
||||||
|
|
||||||
if (klass->flush)
|
if (klass->flush)
|
||||||
|
@ -2458,6 +2465,7 @@ gst_aggregator_pad_init (GstAggregatorPad * pad)
|
||||||
g_mutex_init (&pad->priv->lock);
|
g_mutex_init (&pad->priv->lock);
|
||||||
|
|
||||||
pad->priv->first_buffer = TRUE;
|
pad->priv->first_buffer = TRUE;
|
||||||
|
gst_aggregator_pad_reset_unlocked (pad);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue