mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
avimux: fix assertion when handling a date tag as a string
Date tags are GDate, not strings. Add a special case to convert it to the exif date format representation in string to avoid the assertion
This commit is contained in:
parent
c5196f6b1b
commit
46083803d7
1 changed files with 22 additions and 8 deletions
|
@ -1112,18 +1112,32 @@ gst_avi_mux_write_tag (const GstTagList * list, const gchar * tag,
|
||||||
0, NULL}
|
0, NULL}
|
||||||
};
|
};
|
||||||
gint n;
|
gint n;
|
||||||
gchar *str;
|
gchar *str = NULL;
|
||||||
GstByteWriter *bw = data;
|
GstByteWriter *bw = data;
|
||||||
guint chunk;
|
guint chunk;
|
||||||
|
|
||||||
for (n = 0; rifftags[n].fcc != 0; n++) {
|
for (n = 0; rifftags[n].fcc != 0; n++) {
|
||||||
if (!strcmp (rifftags[n].tag, tag) &&
|
if (!strcmp (rifftags[n].tag, tag)) {
|
||||||
gst_tag_list_get_string (list, tag, &str) && str) {
|
if (rifftags[n].fcc == GST_RIFF_INFO_ICRD) {
|
||||||
chunk = gst_avi_mux_start_chunk (bw, NULL, rifftags[n].fcc);
|
GDate *date;
|
||||||
gst_byte_writer_put_string (bw, str);
|
/* special case for the date tag */
|
||||||
gst_avi_mux_end_chunk (bw, chunk);
|
if (gst_tag_list_get_date (list, tag, &date)) {
|
||||||
g_free (str);
|
str =
|
||||||
break;
|
g_strdup_printf ("%04d:%02d:%02d", g_date_get_year (date),
|
||||||
|
g_date_get_month (date), g_date_get_day (date));
|
||||||
|
g_date_free (date);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
gst_tag_list_get_string (list, tag, &str);
|
||||||
|
}
|
||||||
|
if (str) {
|
||||||
|
chunk = gst_avi_mux_start_chunk (bw, NULL, rifftags[n].fcc);
|
||||||
|
gst_byte_writer_put_string (bw, str);
|
||||||
|
gst_avi_mux_end_chunk (bw, chunk);
|
||||||
|
g_free (str);
|
||||||
|
str = NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue