diff --git a/gb.media/src/c_media.c b/gb.media/src/c_media.c index 3dbabc1b2..a4496d1c7 100644 --- a/gb.media/src/c_media.c +++ b/gb.media/src/c_media.c @@ -336,6 +336,34 @@ static void return_value(const GValue *value) GB.ReturnObject(array); } +#ifdef G_TYPE_VALUE_ARRAY + else if (G_VALUE_HOLDS(value, G_TYPE_VALUE_ARRAY)) + { + GValueArray *garray = (GValueArray *)g_value_get_boxed(value); + guint len = garray->n_values; + GB_ARRAY array; + + GB.Array.New(&array, GB_T_VARIANT, len); + + if (len <= 0) + { + GB.Array.New(&array, GB_T_VARIANT, 0); + } + else + { + GB_VALUE val; + int i; + for (i = 0; i < len; i++) + { + to_gambas_value(g_value_array_get_nth(garray, i), &val); + GB.Store(GB_T_VARIANT, &val, GB.Array.Get(array, i)); + GB.ReleaseValue(&val); + } + } + + GB.ReturnObject(array); + } +#endif else { fprintf(stderr, "gb.media: warning: unsupported datatype: %s\n", G_VALUE_TYPE_NAME(value));