summaryrefslogtreecommitdiff
path: root/gst/mpegtsdemux
diff options
context:
space:
mode:
authorThibault Saunier <thibault.saunier@collabora.com>2012-02-27 09:42:27 -0300
committerThibault Saunier <thibault.saunier@collabora.com>2012-02-27 09:42:27 -0300
commit58a210e3d33498454c41158a1106955705c23773 (patch)
tree02de4649e4dc505f9eb158dacc91f24393d6054c /gst/mpegtsdemux
parent336710d355c598cedb126b318680b44ab082b24e (diff)
downloadgstreamer-plugins-bad-58a210e3d33498454c41158a1106955705c23773.tar.gz
mpegtspacketizer: support more character set encodings
Support UTF-16BE, EUC-KR (KSX1001), GB2312 and ISO-10646/UTF8 text encoding and fixed new line for multibyte encoding https://bugzilla.gnome.org/show_bug.cgi?id=664257 (Port of 9759d66407f2be8ec29975b0eff3230bb1dae0ef from the mpegtsdemux element)
Diffstat (limited to 'gst/mpegtsdemux')
-rw-r--r--gst/mpegtsdemux/mpegtspacketizer.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/gst/mpegtsdemux/mpegtspacketizer.c b/gst/mpegtsdemux/mpegtspacketizer.c
index 7972493f7..2453d35d3 100644
--- a/gst/mpegtsdemux/mpegtspacketizer.c
+++ b/gst/mpegtsdemux/mpegtspacketizer.c
@@ -2542,13 +2542,22 @@ get_encoding (const gchar * text, guint * start_text, gboolean * is_multibyte)
*start_text = 1;
*is_multibyte = TRUE;
} else if (firstbyte == 0x12) {
- /* That's korean encoding.
- * The spec says it's encoded in KSC 5601, but iconv only knows KSC 5636.
- * Couldn't find any information about either of them.
- */
- encoding = NULL;
+ /* EUC-KR implements KSX1001 */
+ encoding = g_strdup ("EUC-KR");
*start_text = 1;
*is_multibyte = TRUE;
+ } else if (firstbyte == 0x13) {
+ encoding = g_strdup ("GB2312");
+ *start_text = 1;
+ *is_multibyte = FALSE;
+ } else if (firstbyte == 0x14) {
+ encoding = g_strdup ("UTF-16BE");
+ *start_text = 1;
+ *is_multibyte = TRUE;
+ } else if (firstbyte == 0x15) {
+ encoding = g_strdup ("ISO-10646/UTF8");
+ *start_text = 1;
+ *is_multibyte = FALSE;
} else {
/* reserved */
encoding = NULL;
@@ -2600,7 +2609,7 @@ convert_to_utf8 (const gchar * text, gint length, guint start,
/* skip it */
break;
case 0xE08A:{
- guint8 nl[] = { 0x0A, 0x00 }; /* new line */
+ guint8 nl[] = { 0x00, 0x0A }; /* new line */
g_byte_array_append (sb, nl, 2);
break;
}
@@ -2621,7 +2630,7 @@ convert_to_utf8 (const gchar * text, gint length, guint start,
/* skip it */
break;
case 0xE08A:{
- guint8 nl[] = { 0x0A, 0x00 }; /* new line */
+ guint8 nl[] = { 0x00, 0x0A }; /* new line */
g_byte_array_append (sb, nl, 2);
break;
}