mpegtspacketizer: Handle all ISO8859-x encodings in get_encoding()

... according to ETSI EN 300 468, "Selection of character table"
This commit is contained in:
Mart Raudsepp 2011-03-21 20:40:14 +02:00 committed by Edward Hervey
parent 3ebc8a43e2
commit b69450af92
2 changed files with 10 additions and 40 deletions

View File

@ -1646,7 +1646,7 @@ mpegts_packetizer_parse_eit (MpegTSPacketizer * packetizer,
DESC_LENGTH (event_descriptor)) { DESC_LENGTH (event_descriptor)) {
eventname_tmp = eventname_tmp =
get_encoding_and_convert (eventname, eventname_length), get_encoding_and_convert (eventname, eventname_length);
eventdescription_tmp = eventdescription_tmp =
get_encoding_and_convert (eventdescription, get_encoding_and_convert (eventdescription,
eventdescription_length); eventdescription_length);
@ -2360,24 +2360,9 @@ get_encoding (const gchar * text, guint * start_text, gboolean * is_multibyte)
firstbyte = (guint8) text[0]; firstbyte = (guint8) text[0];
if (firstbyte == 0x01) { /* ETSI EN 300 468, "Selection of character table" */
encoding = g_strdup ("iso8859-5"); if (firstbyte <= 0x0B) {
*start_text = 1; encoding = g_strdup_printf ("iso8859-%u", firstbyte + 4);
*is_multibyte = FALSE;
} else if (firstbyte == 0x02) {
encoding = g_strdup ("iso8859-6");
*start_text = 1;
*is_multibyte = FALSE;
} else if (firstbyte == 0x03) {
encoding = g_strdup ("iso8859-7");
*start_text = 1;
*is_multibyte = FALSE;
} else if (firstbyte == 0x04) {
encoding = g_strdup ("iso8859-8");
*start_text = 1;
*is_multibyte = FALSE;
} else if (firstbyte == 0x05) {
encoding = g_strdup ("iso8859-9");
*start_text = 1; *start_text = 1;
*is_multibyte = FALSE; *is_multibyte = FALSE;
} else if (firstbyte >= 0x20) { } else if (firstbyte >= 0x20) {

View File

@ -1693,7 +1693,7 @@ mpegts_packetizer_parse_eit (MpegTSPacketizer2 * packetizer,
DESC_LENGTH (event_descriptor)) { DESC_LENGTH (event_descriptor)) {
eventname_tmp = eventname_tmp =
get_encoding_and_convert (eventname, eventname_length), get_encoding_and_convert (eventname, eventname_length);
eventdescription_tmp = eventdescription_tmp =
get_encoding_and_convert (eventdescription, get_encoding_and_convert (eventdescription,
eventdescription_length); eventdescription_length);
@ -2466,24 +2466,9 @@ get_encoding (const gchar * text, guint * start_text, gboolean * is_multibyte)
firstbyte = (guint8) text[0]; firstbyte = (guint8) text[0];
if (firstbyte == 0x01) { /* ETSI EN 300 468, "Selection of character table" */
encoding = g_strdup ("iso8859-5"); if (firstbyte <= 0x0B) {
*start_text = 1; encoding = g_strdup_printf ("iso8859-%u", firstbyte + 4);
*is_multibyte = FALSE;
} else if (firstbyte == 0x02) {
encoding = g_strdup ("iso8859-6");
*start_text = 1;
*is_multibyte = FALSE;
} else if (firstbyte == 0x03) {
encoding = g_strdup ("iso8859-7");
*start_text = 1;
*is_multibyte = FALSE;
} else if (firstbyte == 0x04) {
encoding = g_strdup ("iso8859-8");
*start_text = 1;
*is_multibyte = FALSE;
} else if (firstbyte == 0x05) {
encoding = g_strdup ("iso8859-9");
*start_text = 1; *start_text = 1;
*is_multibyte = FALSE; *is_multibyte = FALSE;
} else if (firstbyte >= 0x20) { } else if (firstbyte >= 0x20) {