videomixer: Create hashtable only when we actually use it

In error cases we previously returned without freeing it.
This commit is contained in:
Sebastian Dröge 2014-04-16 17:33:46 +02:00
parent d3a2b3c73a
commit 74c23f0f4f

View file

@ -308,7 +308,7 @@ gst_videomixer2_update_converters (GstVideoMixer2 * mix)
GstCaps *possible_caps;
gchar *best_colorimetry;
const gchar *best_chroma;
GHashTable *formats_table = g_hash_table_new (g_direct_hash, g_direct_equal);
GHashTable *formats_table;
gint best_format_number = 0;
best_format = GST_VIDEO_FORMAT_UNKNOWN;
@ -319,6 +319,8 @@ gst_videomixer2_update_converters (GstVideoMixer2 * mix)
if (!downstream_caps || gst_caps_is_empty (downstream_caps))
return FALSE;
formats_table = g_hash_table_new (g_direct_hash, g_direct_equal);
/* first find new preferred format */
for (tmp = mix->sinkpads; tmp; tmp = tmp->next) {
GstStructure *s;