summaryrefslogtreecommitdiff
path: root/gst/id3tag
diff options
context:
space:
mode:
authorMichael Smith <msmith@songbirdnest.com>2009-10-05 11:15:03 -0700
committerMichael Smith <msmith@songbirdnest.com>2009-10-05 11:15:41 -0700
commit196acecc04f76bdb26eab53c7494c771ec63b3a1 (patch)
treee6407f41cde63efea42b786011b004c385b397f6 /gst/id3tag
parent2c81532f29ac439450710b1825004e5c0d034bc2 (diff)
downloadgstreamer-plugins-bad-196acecc04f76bdb26eab53c7494c771ec63b3a1.tar.gz
id3mux: Write UTF-16 byte order marker correctly.
Diffstat (limited to 'gst/id3tag')
-rw-r--r--gst/id3tag/id3tag.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gst/id3tag/id3tag.c b/gst/id3tag/id3tag.c
index 7af74fc65..bd481e1f3 100644
--- a/gst/id3tag/id3tag.c
+++ b/gst/id3tag/id3tag.c
@@ -363,7 +363,8 @@ id3v2_frame_write_string (GstId3v2Frame * frame, int encoding,
int terminator_length;
if (encoding == ID3V2_ENCODING_UTF16_BOM) {
gsize utf16len;
- /* This converts to little-endian UTF-16, WITH a byte-order-marker */
+ const guint8 bom[] = { 0xFF, 0xFE };
+ /* This converts to little-endian UTF-16 */
gchar *utf16 = g_convert (string, -1, "UTF-16LE", "UTF-8",
NULL, &utf16len, NULL);
if (!utf16) {
@@ -371,6 +372,8 @@ id3v2_frame_write_string (GstId3v2Frame * frame, int encoding,
return;
}
+ /* Write the BOM */
+ id3v2_frame_write_bytes (frame, (const guint8 *) bom, 2);
/* NUL terminator is 2 bytes, if present */
terminator_length = null_terminate ? 2 : 0;
id3v2_frame_write_bytes (frame, (const guint8 *) utf16,