/***** evil macros to get all the gst_tag_list_get_*() functions right *****/
-#define TAG_MERGE_FUNCS(name,type) \
+#define TAG_MERGE_FUNCS(name,type,ret) \
gboolean \
gst_tag_list_get_ ## name (const GstTagList *list, const gchar *tag, \
type *value) \
return FALSE; \
*value = COPY_FUNC (g_value_get_ ## name (&v)); \
g_value_unset (&v); \
- return TRUE; \
+ return ret; \
} \
\
gboolean \
if ((v = gst_tag_list_get_value_index (list, tag, index)) == NULL) \
return FALSE; \
*value = COPY_FUNC (g_value_get_ ## name (v)); \
- return TRUE; \
+ return ret; \
}
/* FIXME 0.11: maybe get rid of _get_char*(), _get_uchar*(), _get_long*(),
* Returns: TRUE, if a value was copied, FALSE if the tag didn't exist in the
* given list.
*/
-TAG_MERGE_FUNCS (char, gchar)
+TAG_MERGE_FUNCS (char, gchar, TRUE)
/**
* gst_tag_list_get_uchar:
* @list: a #GstTagList to get the tag from
* Returns: TRUE, if a value was copied, FALSE if the tag didn't exist in the
* given list.
*/
-TAG_MERGE_FUNCS (uchar, guchar)
+TAG_MERGE_FUNCS (uchar, guchar, TRUE)
/**
* gst_tag_list_get_boolean:
* @list: a #GstTagList to get the tag from
* Returns: TRUE, if a value was copied, FALSE if the tag didn't exist in the
* given list.
*/
-TAG_MERGE_FUNCS (boolean, gboolean)
+TAG_MERGE_FUNCS (boolean, gboolean, TRUE)
/**
* gst_tag_list_get_int:
* @list: a #GstTagList to get the tag from
* Returns: TRUE, if a value was copied, FALSE if the tag didn't exist in the
* given list.
*/
-TAG_MERGE_FUNCS (int, gint)
+TAG_MERGE_FUNCS (int, gint, TRUE)
/**
* gst_tag_list_get_uint:
* @list: a #GstTagList to get the tag from
* Returns: TRUE, if a value was copied, FALSE if the tag didn't exist in the
* given list.
*/
-TAG_MERGE_FUNCS (uint, guint)
+TAG_MERGE_FUNCS (uint, guint, TRUE)
/**
* gst_tag_list_get_long:
* @list: a #GstTagList to get the tag from
* Returns: TRUE, if a value was copied, FALSE if the tag didn't exist in the
* given list.
*/
-TAG_MERGE_FUNCS (long, glong)
+TAG_MERGE_FUNCS (long, glong, TRUE)
/**
* gst_tag_list_get_ulong:
* @list: a #GstTagList to get the tag from
* Returns: TRUE, if a value was copied, FALSE if the tag didn't exist in the
* given list.
*/
-TAG_MERGE_FUNCS (ulong, gulong)
+TAG_MERGE_FUNCS (ulong, gulong, TRUE)
/**
* gst_tag_list_get_int64:
* @list: a #GstTagList to get the tag from
* Returns: TRUE, if a value was copied, FALSE if the tag didn't exist in the
* given list.
*/
-TAG_MERGE_FUNCS (int64, gint64)
+TAG_MERGE_FUNCS (int64, gint64, TRUE)
/**
* gst_tag_list_get_uint64:
* @list: a #GstTagList to get the tag from
* Returns: TRUE, if a value was copied, FALSE if the tag didn't exist in the
* given list.
*/
-TAG_MERGE_FUNCS (uint64, guint64)
+TAG_MERGE_FUNCS (uint64, guint64, TRUE)
/**
* gst_tag_list_get_float:
* @list: a #GstTagList to get the tag from
* Returns: TRUE, if a value was copied, FALSE if the tag didn't exist in the
* given list.
*/
-TAG_MERGE_FUNCS (float, gfloat)
+TAG_MERGE_FUNCS (float, gfloat, TRUE)
/**
* gst_tag_list_get_double:
* @list: a #GstTagList to get the tag from
* Returns: TRUE, if a value was copied, FALSE if the tag didn't exist in the
* given list.
*/
-TAG_MERGE_FUNCS (double, gdouble)
+TAG_MERGE_FUNCS (double, gdouble, TRUE)
/**
* gst_tag_list_get_pointer:
* @list: a #GstTagList to get the tag from
* Returns: TRUE, if a value was copied, FALSE if the tag didn't exist in the
* given list.
*/
-TAG_MERGE_FUNCS (pointer, gpointer)
+TAG_MERGE_FUNCS (pointer, gpointer, (*value != NULL))
#undef COPY_FUNC
#define COPY_FUNC g_strdup
/**
* Returns: TRUE, if a value was copied, FALSE if the tag didn't exist in the
* given list.
*/
-TAG_MERGE_FUNCS (string, gchar *)
+TAG_MERGE_FUNCS (string, gchar *, (*value != NULL && **value != '\0'))
/**
* gst_tag_list_get_date: