mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-24 23:16:30 +00:00
gst-launch: fix potential uninitialized variable warning
https://bugzilla.gnome.org/show_bug.cgi?id=710758
This commit is contained in:
parent
a3431f5d8b
commit
a0e2eb6169
1 changed files with 10 additions and 8 deletions
|
@ -335,11 +335,13 @@ print_tag (const GstTagList * list, const gchar * tag, gpointer unused)
|
||||||
count = gst_tag_list_get_tag_size (list, tag);
|
count = gst_tag_list_get_tag_size (list, tag);
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
gchar *str;
|
gchar *str = NULL;
|
||||||
|
|
||||||
if (gst_tag_get_type (tag) == G_TYPE_STRING) {
|
if (gst_tag_get_type (tag) == G_TYPE_STRING) {
|
||||||
if (!gst_tag_list_get_string_index (list, tag, i, &str))
|
if (!gst_tag_list_get_string_index (list, tag, i, &str)) {
|
||||||
|
g_warning ("Couldn't fetch string for %s tag", tag);
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
|
}
|
||||||
} else if (gst_tag_get_type (tag) == GST_TYPE_SAMPLE) {
|
} else if (gst_tag_get_type (tag) == GST_TYPE_SAMPLE) {
|
||||||
GstSample *sample = NULL;
|
GstSample *sample = NULL;
|
||||||
|
|
||||||
|
@ -362,6 +364,9 @@ print_tag (const GstTagList * list, const gchar * tag, gpointer unused)
|
||||||
} else {
|
} else {
|
||||||
str = g_strdup ("NULL buffer");
|
str = g_strdup ("NULL buffer");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
g_warning ("Couldn't fetch sample for %s tag", tag);
|
||||||
|
g_assert_not_reached ();
|
||||||
}
|
}
|
||||||
} else if (gst_tag_get_type (tag) == GST_TYPE_DATE_TIME) {
|
} else if (gst_tag_get_type (tag) == GST_TYPE_DATE_TIME) {
|
||||||
GstDateTime *dt = NULL;
|
GstDateTime *dt = NULL;
|
||||||
|
@ -392,15 +397,12 @@ print_tag (const GstTagList * list, const gchar * tag, gpointer unused)
|
||||||
g_strdup_value_contents (gst_tag_list_get_value_index (list, tag, i));
|
g_strdup_value_contents (gst_tag_list_get_value_index (list, tag, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == 0) {
|
if (str) {
|
||||||
PRINT ("%16s: %s\n", gst_tag_get_nick (tag), str);
|
PRINT ("%16s: %s\n", i == 0 ? gst_tag_get_nick (tag) : "", str);
|
||||||
} else {
|
|
||||||
PRINT ("%16s: %s\n", "", str);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_free (str);
|
g_free (str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_tag_foreach (const GstTagList * tags, const gchar * tag,
|
print_tag_foreach (const GstTagList * tags, const gchar * tag,
|
||||||
|
|
Loading…
Reference in a new issue