mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
goom: code cleanups
Move variables to the scope where they are needed. Use our macros and functions more.
This commit is contained in:
parent
3e82471125
commit
931354215e
1 changed files with 4 additions and 6 deletions
|
@ -543,7 +543,6 @@ gst_goom_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
const guint16 *data;
|
const guint16 *data;
|
||||||
gboolean need_skip;
|
|
||||||
guchar *out_frame;
|
guchar *out_frame;
|
||||||
gint i;
|
gint i;
|
||||||
guint avail, to_flush;
|
guint avail, to_flush;
|
||||||
|
@ -570,12 +569,12 @@ gst_goom_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
timestamp += gst_util_uint64_scale_int (dist, GST_SECOND, goom->rate);
|
timestamp += gst_util_uint64_scale_int (dist, GST_SECOND, goom->rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timestamp != -1) {
|
if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
|
||||||
gint64 qostime;
|
gint64 qostime;
|
||||||
|
gboolean need_skip;
|
||||||
|
|
||||||
qostime = gst_segment_to_running_time (&goom->segment, GST_FORMAT_TIME,
|
qostime = gst_segment_to_running_time (&goom->segment, GST_FORMAT_TIME,
|
||||||
timestamp);
|
timestamp) + goom->duration;
|
||||||
qostime += goom->duration;
|
|
||||||
|
|
||||||
GST_OBJECT_LOCK (goom);
|
GST_OBJECT_LOCK (goom);
|
||||||
/* check for QoS, don't compute buffers that are known to be late */
|
/* check for QoS, don't compute buffers that are known to be late */
|
||||||
|
@ -677,8 +676,7 @@ gst_goom_change_state (GstElement * element, GstStateChange transition)
|
||||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||||
if (goom->pool) {
|
if (goom->pool) {
|
||||||
gst_buffer_pool_set_active (goom->pool, FALSE);
|
gst_buffer_pool_set_active (goom->pool, FALSE);
|
||||||
gst_object_unref (goom->pool);
|
gst_object_replace ((GstObject **) & goom->pool, NULL);
|
||||||
goom->pool = NULL;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||||
|
|
Loading…
Reference in a new issue