GNOME Bugzilla – Bug 423051
Vorbis tags of type double use locale-dependent formatting
Last modified: 2007-03-26 22:38:35 UTC
gst-plugins-base/gst-libs/gst/tag/gstvorbistag.c:gst_tag_to_vorbis_comments contains this: /* FIXME: what about locale-specific floating point separators? */ result = g_strdup_printf ("%s=%f", vorbis_tag, value); This results in values of double type tags (ReplayGain) being possibly written out with "," as a decimal separator. I'm attaching a simple patch that replaces this with g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", value); result = g_strconcat (vorbis_tag, "=", buf, NULL); This also uses at most 6 digits after the decimal point (using g_ascii_dtostr here seems like overkill indeed) but formats the value irregardless of the current locale.
Created attachment 85331 [details] [review] Use g_ascii_formatd for double type tag value formatting
Committed, thanks: 2007-03-26 Tim-Philipp Müller <tim at centricular dot net> Patch by: René Stadler <mail at renestadler de> * gst-libs/gst/tag/gstvorbistag.c: (gst_tag_to_vorbis_comments): When writing out floating-point numbers to vorbis comment tags, always use the same character as separator no matter what the current locale is (fixes #423051). * tests/check/libs/tag.c: (GST_START_TEST): Add unit tests for replaygain tags in vorbis comments (closes #423055).