summaryrefslogtreecommitdiff
path: root/sys/androidmedia
diff options
context:
space:
mode:
authorMartin Kelly <martin@surround.io>2016-03-15 16:22:59 -0700
committerSebastian Dröge <sebastian@centricular.com>2016-03-24 14:59:42 +0200
commitd6a17cd3cc5e56a87047f259036c713f8c66d821 (patch)
tree527abd2ac6634462985de1ebd6b6fa719d6e6245 /sys/androidmedia
parent66bac3eb8606ead677bc6bdd7b9f2b34bc5061ad (diff)
ahc: use g_slice_new instead of g_slice_new0
In many cases, we use g_slice_new0 and then immediately overwrite the allocated memory. This is inefficient. Since we're going to immediately overwrite it, we might as well use plain g_slice_new. https://bugzilla.gnome.org/show_bug.cgi?id=763998
Diffstat (limited to 'sys/androidmedia')
-rw-r--r--sys/androidmedia/gst-android-hardware-camera.c5
-rw-r--r--sys/androidmedia/gstahcsrc.c4
2 files changed, 4 insertions, 5 deletions
diff --git a/sys/androidmedia/gst-android-hardware-camera.c b/sys/androidmedia/gst-android-hardware-camera.c
index 972f114b7..876800b70 100644
--- a/sys/androidmedia/gst-android-hardware-camera.c
+++ b/sys/androidmedia/gst-android-hardware-camera.c
@@ -2606,7 +2606,7 @@ gst_ah_camera_unlock (GstAHCamera * self)
GstAHCSize *
gst_ahc_size_new (gint width, gint height)
{
- GstAHCSize *self = g_slice_new0 (GstAHCSize);
+ GstAHCSize *self = g_slice_new (GstAHCSize);
self->width = width;
self->height = height;
@@ -3374,8 +3374,7 @@ gst_ahc_parameters_get_preview_size (GstAHCParameters * self)
goto done;
}
- size = g_slice_new0 (GstAHCSize);
-
+ size = g_slice_new (GstAHCSize);
size->width = (*env)->GetIntField (env, jsize,
android_hardware_camera_size.width);
if ((*env)->ExceptionCheck (env)) {
diff --git a/sys/androidmedia/gstahcsrc.c b/sys/androidmedia/gstahcsrc.c
index c568a01ba..08ac4cd96 100644
--- a/sys/androidmedia/gstahcsrc.c
+++ b/sys/androidmedia/gstahcsrc.c
@@ -2125,7 +2125,7 @@ gst_ahc_src_on_preview_frame (jbyteArray array, gpointer user_data)
GST_DEBUG_OBJECT (self, "Received data buffer %p", array);
- malloc_data = g_slice_new0 (FreeFuncBuffer);
+ malloc_data = g_slice_new (FreeFuncBuffer);
malloc_data->self = gst_object_ref (self);
malloc_data->array = (*env)->NewGlobalRef (env, array);
malloc_data->data = (*env)->GetByteArrayElements (env, array, NULL);
@@ -2140,7 +2140,7 @@ gst_ahc_src_on_preview_frame (jbyteArray array, gpointer user_data)
GST_DEBUG_OBJECT (self, "creating wrapped buffer (size: %d)",
self->buffer_size);
- item = g_slice_new0 (GstDataQueueItem);
+ item = g_slice_new (GstDataQueueItem);
item->object = GST_MINI_OBJECT (buffer);
item->size = gst_buffer_get_size (buffer);
item->duration = GST_BUFFER_DURATION (buffer);