summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2008-01-06 15:56:24 +0000
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2008-01-06 15:56:24 +0000
commit3b8eab0196256be7240878cb718fceb7cd373549 (patch)
tree0f5b0f5d337f24ddcddf3b22d480fe06d002e805
parent45aa7ebe596abd3263c747c642a2416a7ebbbbba (diff)
downloadxine-lib-3b8eab0196256be7240878cb718fceb7cd373549.tar.gz
xine-lib-3b8eab0196256be7240878cb718fceb7cd373549.tar.bz2
Constify bits of the OGM subtitle hack. Add a changelog entry.
-rw-r--r--ChangeLog2
-rw-r--r--src/libsputext/xine_sputext_decoder.c14
2 files changed, 8 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 47ece9b70..274c4117c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -43,6 +43,8 @@ xine-lib (1.1.9) (unreleased)
* Fixed an issue in input_pvr with setting the frequency of the tuner for
ivtv versions 0.10.6+
* Add Turkish translation by Serdar Soytetir and Server Acim.
+ * Workaround for subtitle rendering when using variable-length character
+ encodings other than UTF-8. (There is probably still some breakage here.)
xine-lib (1.1.8)
* Send a channel-changed event to the frontend when receiving the SYNC
diff --git a/src/libsputext/xine_sputext_decoder.c b/src/libsputext/xine_sputext_decoder.c
index d45886300..d0cab9cbf 100644
--- a/src/libsputext/xine_sputext_decoder.c
+++ b/src/libsputext/xine_sputext_decoder.c
@@ -507,10 +507,8 @@ static void read_ssa_tag(sputext_decoder_t *this, const char* text,
}
static int is_cjk_encoding(const char *enc) {
- char **pstr;
-
/* CJK charset strings defined in iconvdata/gconv-modules of glibc */
- static char *cjk_encoding_strings[] = {
+ static const char cjk_encoding_strings[][16] = {
"SJIS",
"CP932",
"EUC-KR",
@@ -534,15 +532,15 @@ static int is_cjk_encoding(const char *enc) {
"GB18030",
"EUC-JISX0213",
"SHIFT_JISX0213",
- NULL
};
+ int pstr;
+
/* return 1 if encoding string is one of the CJK(Chinese,Jananese,Korean)
* character set strings. */
- for (pstr = cjk_encoding_strings; *pstr; pstr++) {
- if (strcasecmp(enc, *pstr) == 0)
+ for (pstr = 0; pstr < sizeof (cjk_encoding_strings) / sizeof (cjk_encoding_strings[0]); pstr++)
+ if (strcasecmp (enc, cjk_encoding_strings[pstr]) == 0)
return 1;
- }
return 0;
}
@@ -552,7 +550,7 @@ static void draw_subtitle(sputext_decoder_t *this, int64_t sub_start, int64_t su
int line, y;
int font_size;
char *font;
- char *encoding = (this->buf_encoding)?this->buf_encoding:
+ const char *encoding = (this->buf_encoding)?this->buf_encoding:
this->class->src_encoding;
int sub_x, sub_y, max_width;
int alignment;