From e3b911f7a967a00a57a62e5a117b290352a91e68 Mon Sep 17 00:00:00 2001 From: Julien Moutte Date: Tue, 14 Aug 2007 13:43:44 +0000 Subject: [PATCH] gst/gstindex.c: Fix index entry generation from vargs. Fixes #466595. Original commit message from CVS: 2007-08-14 Julien MOUTTE * gst/gstindex.c: (gst_index_add_association): Fix index entry generation from vargs. Fixes #466595. --- ChangeLog | 5 +++++ gst/gstindex.c | 24 ++++++++++++++---------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index ca60622..6682d76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-08-14 Julien MOUTTE + + * gst/gstindex.c: (gst_index_add_association): Fix index entry + generation from vargs. Fixes #466595. + 2007-08-14 Wim Taymans * gst/gstbin.c: (gst_bin_element_set_state): diff --git a/gst/gstindex.c b/gst/gstindex.c index a7681b5..7b2a73d 100644 --- a/gst/gstindex.c +++ b/gst/gstindex.c @@ -736,22 +736,26 @@ gst_index_add_association (GstIndex * index, gint id, GstAssocFlags flags, array = g_array_new (FALSE, FALSE, sizeof (GstIndexAssociation)); + { + GstIndexAssociation a; + + a.format = format; + a.value = value; + n_assocs = 1; + g_array_append_val (array, a); + } + va_start (args, value); - cur_format = format; - n_assocs = 0; - while (cur_format) { + while ((cur_format = va_arg (args, GstFormat))) { GstIndexAssociation a; + a.format = cur_format; + a.value = va_arg (args, gint64); n_assocs++; - cur_format = va_arg (args, GstFormat); - if (cur_format) { - a.format = cur_format; - a.value = va_arg (args, gint64); - - g_array_append_val (array, a); - } + g_array_append_val (array, a); } + va_end (args); list = (GstIndexAssociation *) g_array_free (array, FALSE); -- 2.7.4