From 287115c35750cd21a5944890aaf8250af8e2b3ef Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 14 Jul 2014 15:21:24 +0530 Subject: appsink: Use the correct API for getting the streamheader Pointed out in a review by slomo --- src/lib.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lib.c b/src/lib.c index f252d1f..115249a 100644 --- a/src/lib.c +++ b/src/lib.c @@ -153,16 +153,14 @@ stp_disconnect_cleanup_client (TranscodeClientCtx *ctx) GstBuffer* stp_get_streamheader_from_caps (GstCaps *caps) { - GArray *array; GstStructure *s; - const GValue *value; + const GValue *array, *value; s = gst_caps_get_structure (caps, 0); - value = gst_structure_get_value (s, "streamheader"); - g_return_val_if_fail (G_IS_VALUE (value), NULL); + array = gst_structure_get_value (s, "streamheader"); + g_return_val_if_fail (GST_VALUE_HOLDS_ARRAY (array), NULL); - array = g_value_peek_pointer (value); - value = &g_array_index (array, GValue, 0); + value = gst_value_array_get_value (array, 0); g_return_val_if_fail (G_VALUE_TYPE (value) == GST_TYPE_BUFFER, NULL); return gst_buffer_copy (g_value_peek_pointer (value)); -- cgit v0.11.2-2-gd1dd