summaryrefslogtreecommitdiff
path: root/src/spu_dec
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2008-01-06 21:20:29 +0000
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2008-01-06 21:20:29 +0000
commit28665f4a2ca6dea9eaafba8d2abbd9472bd061db (patch)
tree6401e38414451275d48d58b7939dc1feee41178b /src/spu_dec
parenta2a95425350da93551388acdca8a00818a34c317 (diff)
parent6255dcb866af030b0122c061459ab587a0d8c074 (diff)
downloadxine-lib-28665f4a2ca6dea9eaafba8d2abbd9472bd061db.tar.gz
xine-lib-28665f4a2ca6dea9eaafba8d2abbd9472bd061db.tar.bz2
Merge from 1.1.
--HG-- rename : src/xine-engine/buffer.h => include/xine/buffer.h rename : src/libffmpeg/ff_video_decoder.c => src/combined/ffmpeg/ff_video_decoder.c rename : src/libsputext/xine_sputext_decoder.c => src/spu_dec/sputext_decoder.c
Diffstat (limited to 'src/spu_dec')
-rw-r--r--src/spu_dec/sputext_decoder.c48
1 files changed, 47 insertions, 1 deletions
diff --git a/src/spu_dec/sputext_decoder.c b/src/spu_dec/sputext_decoder.c
index 093fca1e7..0cc0ee21b 100644
--- a/src/spu_dec/sputext_decoder.c
+++ b/src/spu_dec/sputext_decoder.c
@@ -507,11 +507,52 @@ static void read_ssa_tag(sputext_decoder_t *this, const char* text,
(*sub_x), (*sub_y), (*max_width), (*alignment));
}
+static int is_cjk_encoding(const char *enc) {
+ /* CJK charset strings defined in iconvdata/gconv-modules of glibc */
+ static const char cjk_encoding_strings[][16] = {
+ "SJIS",
+ "CP932",
+ "EUC-KR",
+ "UHC",
+ "JOHAB",
+ "BIG5",
+ "BIG5HKSCS",
+ "EUC-JP-MS",
+ "EUC-JP",
+ "EUC-CN",
+ "GBBIG5",
+ "GBK",
+ "GBGBK",
+ "EUC-TW",
+ "ISO-2022-JP",
+ "ISO-2022-JP-2",
+ "ISO-2022-JP-3",
+ "ISO-2022-KR",
+ "ISO-2022-CN",
+ "ISO-2022-CN-EXT",
+ "GB18030",
+ "EUC-JISX0213",
+ "SHIFT_JISX0213",
+ };
+
+ int pstr;
+
+ /* return 1 if encoding string is one of the CJK(Chinese,Jananese,Korean)
+ * character set strings. */
+ 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;
+}
+
static void draw_subtitle(sputext_decoder_t *this, int64_t sub_start, int64_t sub_end ) {
int line, y;
int font_size;
char *font;
+ const char *encoding = (this->buf_encoding)?this->buf_encoding:
+ this->class->src_encoding;
int sub_x, sub_y, max_width;
int alignment;
int rebuild_all;
@@ -720,7 +761,12 @@ static void draw_subtitle(sputext_decoder_t *this, int64_t sub_start, int64_t su
}
}
- ogm_render_line(this, x, y + line*this->line_height, this->text[line]);
+ if( is_cjk_encoding(encoding) ) {
+ this->renderer->render_text (this->osd, x, y + line * this->line_height,
+ this->text[line], OSD_TEXT1);
+ } else {
+ ogm_render_line(this, x, y + line*this->line_height, this->text[line]);
+ }
}
if( font_size != this->font_size )