From 0915cb0e789cd04c6e07a06c74026a65db9d5de4 Mon Sep 17 00:00:00 2001 From: Luis de Bethencourt Date: Thu, 9 Apr 2015 11:23:25 +0100 Subject: [PATCH] examples: reuse variables in encoding example --- tests/examples/encoding/encoding.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tests/examples/encoding/encoding.c b/tests/examples/encoding/encoding.c index bde601c..1861f81 100644 --- a/tests/examples/encoding/encoding.c +++ b/tests/examples/encoding/encoding.c @@ -1,4 +1,7 @@ -/* Example application for using GstProfile and encodebin +/* GStreamer + * + * encoding.c: example application for using GstProfile and encodebin + * * Copyright (C) 2009 Edward Hervey * * This library is free software; you can redistribute it and/or @@ -34,9 +37,10 @@ static gboolean silent = FALSE; static void list_codecs (void) { - GstCaps *l; - GstCaps *caps; + GstCaps *l, *caps; + GstStructure *st; guint i, len; + gchar *tmpstr, *desc; caps = gst_caps_new_empty (); @@ -44,9 +48,7 @@ list_codecs (void) l = gst_caps_list_container_formats (GST_RANK_NONE); len = gst_caps_get_size (l); for (i = 0; i < len; i++) { - GstStructure *st = gst_caps_steal_structure (l, 0); - gchar *tmpstr, *desc; - + st = gst_caps_steal_structure (l, 0); gst_caps_append_structure (caps, st); tmpstr = gst_caps_to_string (caps); @@ -64,9 +66,7 @@ list_codecs (void) l = gst_caps_list_video_encoding_formats (GST_RANK_NONE); len = gst_caps_get_size (l); for (i = 0; i < len; i++) { - GstStructure *st = gst_caps_steal_structure (l, 0); - gchar *tmpstr, *desc; - + st = gst_caps_steal_structure (l, 0); gst_caps_append_structure (caps, st); tmpstr = gst_caps_to_string (caps); @@ -84,9 +84,7 @@ list_codecs (void) l = gst_caps_list_audio_encoding_formats (GST_RANK_NONE); len = gst_caps_get_size (l); for (i = 0; i < len; i++) { - GstStructure *st = gst_caps_steal_structure (l, 0); - gchar *tmpstr, *desc; - + st = gst_caps_steal_structure (l, 0); gst_caps_append_structure (caps, st); tmpstr = gst_caps_to_string (caps); -- 2.7.4