summaryrefslogtreecommitdiff
path: root/gst/gstpad.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst/gstpad.c')
-rw-r--r--gst/gstpad.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gst/gstpad.c b/gst/gstpad.c
index 9dc09ef63e..20069f6957 100644
--- a/gst/gstpad.c
+++ b/gst/gstpad.c
@@ -146,9 +146,7 @@ static GstFlowQuarks flow_quarks[] = {
146 {GST_FLOW_NOT_NEGOTIATED, "not-negotiated", 0}, 146 {GST_FLOW_NOT_NEGOTIATED, "not-negotiated", 0},
147 {GST_FLOW_ERROR, "error", 0}, 147 {GST_FLOW_ERROR, "error", 0},
148 {GST_FLOW_NOT_SUPPORTED, "not-supported", 0}, 148 {GST_FLOW_NOT_SUPPORTED, "not-supported", 0},
149 {GST_FLOW_CUSTOM_ERROR, "custom-error", 0}, 149 {GST_FLOW_CUSTOM_ERROR, "custom-error", 0}
150
151 {0, NULL, 0}
152}; 150};
153 151
154/** 152/**
@@ -166,7 +164,7 @@ gst_flow_get_name (GstFlowReturn ret)
166 164
167 ret = CLAMP (ret, GST_FLOW_CUSTOM_ERROR, GST_FLOW_CUSTOM_SUCCESS); 165 ret = CLAMP (ret, GST_FLOW_CUSTOM_ERROR, GST_FLOW_CUSTOM_SUCCESS);
168 166
169 for (i = 0; flow_quarks[i].name; i++) { 167 for (i = 0; i < G_N_ELEMENTS (flow_quarks); i++) {
170 if (ret == flow_quarks[i].ret) 168 if (ret == flow_quarks[i].ret)
171 return flow_quarks[i].name; 169 return flow_quarks[i].name;
172 } 170 }
@@ -189,7 +187,7 @@ gst_flow_to_quark (GstFlowReturn ret)
189 187
190 ret = CLAMP (ret, GST_FLOW_CUSTOM_ERROR, GST_FLOW_CUSTOM_SUCCESS); 188 ret = CLAMP (ret, GST_FLOW_CUSTOM_ERROR, GST_FLOW_CUSTOM_SUCCESS);
191 189
192 for (i = 0; flow_quarks[i].name; i++) { 190 for (i = 0; i < G_N_ELEMENTS (flow_quarks); i++) {
193 if (ret == flow_quarks[i].ret) 191 if (ret == flow_quarks[i].ret)
194 return flow_quarks[i].quark; 192 return flow_quarks[i].quark;
195 } 193 }
@@ -203,7 +201,7 @@ gst_flow_to_quark (GstFlowReturn ret)
203 buffer_quark = g_quark_from_static_string ("buffer"); \ 201 buffer_quark = g_quark_from_static_string ("buffer"); \
204 event_quark = g_quark_from_static_string ("event"); \ 202 event_quark = g_quark_from_static_string ("event"); \
205 \ 203 \
206 for (i = 0; flow_quarks[i].name; i++) { \ 204 for (i = 0; i < G_N_ELEMENTS (flow_quarks); i++) { \
207 flow_quarks[i].quark = g_quark_from_static_string (flow_quarks[i].name); \ 205 flow_quarks[i].quark = g_quark_from_static_string (flow_quarks[i].name); \
208 } \ 206 } \
209 \ 207 \
@@ -2293,10 +2291,11 @@ fixate_value (GValue * dest, const GValue * src)
2293 g_value_unset (&temp); 2291 g_value_unset (&temp);
2294 } else if (G_VALUE_TYPE (src) == GST_TYPE_ARRAY) { 2292 } else if (G_VALUE_TYPE (src) == GST_TYPE_ARRAY) {
2295 gboolean res = FALSE; 2293 gboolean res = FALSE;
2296 guint n; 2294 guint n, len;
2297 2295
2296 len = gst_value_array_get_size (src);
2298 g_value_init (dest, GST_TYPE_ARRAY); 2297 g_value_init (dest, GST_TYPE_ARRAY);
2299 for (n = 0; n < gst_value_array_get_size (src); n++) { 2298 for (n = 0; n < len; n++) {
2300 GValue kid = { 0 }; 2299 GValue kid = { 0 };
2301 const GValue *orig_kid = gst_value_array_get_value (src, n); 2300 const GValue *orig_kid = gst_value_array_get_value (src, n);
2302 2301
@@ -2345,7 +2344,7 @@ void
2345gst_pad_fixate_caps (GstPad * pad, GstCaps * caps) 2344gst_pad_fixate_caps (GstPad * pad, GstCaps * caps)
2346{ 2345{
2347 GstPadFixateCapsFunction fixatefunc; 2346 GstPadFixateCapsFunction fixatefunc;
2348 guint n; 2347 guint n, len;
2349 2348
2350 g_return_if_fail (GST_IS_PAD (pad)); 2349 g_return_if_fail (GST_IS_PAD (pad));
2351 g_return_if_fail (caps != NULL); 2350 g_return_if_fail (caps != NULL);
@@ -2359,7 +2358,8 @@ gst_pad_fixate_caps (GstPad * pad, GstCaps * caps)
2359 } 2358 }
2360 2359
2361 /* default fixation */ 2360 /* default fixation */
2362 for (n = 0; n < gst_caps_get_size (caps); n++) { 2361 len = gst_caps_get_size (caps);
2362 for (n = 0; n < len; n++) {
2363 GstStructure *s = gst_caps_get_structure (caps, n); 2363 GstStructure *s = gst_caps_get_structure (caps, n);
2364 2364
2365 gst_structure_foreach (s, gst_pad_default_fixate, s); 2365 gst_structure_foreach (s, gst_pad_default_fixate, s);