diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-12-13 22:20:44 +0100 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-12-13 22:20:44 +0100 |
commit | 42d23a86ff422f650b16ec786f5e96b126ec680a (patch) | |
tree | 991158f109e0ac97adbe7510529e535fc06234f4 /src/libsputext | |
parent | 44234828cf17a0a302975dc3f5f8b671f86a8ac2 (diff) | |
parent | fc2fa145300536b0a19f878212912e9b2d5b57a1 (diff) | |
download | xine-lib-last-internal-ffmpeg.tar.gz xine-lib-last-internal-ffmpeg.tar.bz2 |
Merge changes from 1.2 main.last-internal-ffmpeg
Diffstat (limited to 'src/libsputext')
-rw-r--r-- | src/libsputext/demux_sputext.c | 27 | ||||
-rw-r--r-- | src/libsputext/xine_sputext_decoder.c | 3 |
2 files changed, 13 insertions, 17 deletions
diff --git a/src/libsputext/demux_sputext.c b/src/libsputext/demux_sputext.c index 69eb28388..811bdcbd6 100644 --- a/src/libsputext/demux_sputext.c +++ b/src/libsputext/demux_sputext.c @@ -754,8 +754,9 @@ static subtitle_t *sub_read_line_jacobsub(demux_sputext_t *this, subtitle_t *cur int hours = 0, minutes = 0, seconds, delta, inverter = 1; unsigned units = jacoShift; - switch (toupper(line1[1])) { + switch (line1[1]) { case 'S': + case 's': if (isalpha(line1[2])) { delta = 6; } else { @@ -791,6 +792,7 @@ static subtitle_t *sub_read_line_jacobsub(demux_sputext_t *this, subtitle_t *cur } break; case 'T': + case 't': if (isalpha(line1[2])) { delta = 8; } else { @@ -825,26 +827,19 @@ static subtitle_t *sub_read_line_jacobsub(demux_sputext_t *this, subtitle_t *cur ++p; } if (isalpha(*p)||*p == '[') { - int cont, jLength; - if (sscanf(p, "%s %" LINE_LEN_QUOT "[^\n\r]", directive, line1) < 2) return ERR; - jLength = strlen(directive); - for (cont = 0; cont < jLength; ++cont) { - if (isalpha(*(directive + cont))) - *(directive + cont) = toupper(*(directive + cont)); - } - if ((strstr(directive, "RDB") != NULL) - || (strstr(directive, "RDC") != NULL) - || (strstr(directive, "RLB") != NULL) - || (strstr(directive, "RLG") != NULL)) { + if ((strcasestr(directive, "RDB") != NULL) + || (strcasestr(directive, "RDC") != NULL) + || (strcasestr(directive, "RLB") != NULL) + || (strcasestr(directive, "RLG") != NULL)) { continue; } /* no alignment */ #if 0 - if (strstr(directive, "JL") != NULL) { + if (strcasestr(directive, "JL") != NULL) { current->alignment = SUB_ALIGNMENT_HLEFT; - } else if (strstr(directive, "JR") != NULL) { + } else if (strcasestr(directive, "JR") != NULL) { current->alignment = SUB_ALIGNMENT_HRIGHT; } else { current->alignment = SUB_ALIGNMENT_HCENTER; @@ -889,8 +884,8 @@ static subtitle_t *sub_read_line_jacobsub(demux_sputext_t *this, subtitle_t *cur ++p; break; } - if ((toupper(*(p + 1)) == 'C') - || (toupper(*(p + 1)) == 'F')) { + if ((*(p + 1) == 'C') || (*(p + 1) == 'c') || + (*(p + 1) == 'F') || (*(p + 1) == 'f')) { ++p,++p; break; } diff --git a/src/libsputext/xine_sputext_decoder.c b/src/libsputext/xine_sputext_decoder.c index f67fd7a7e..d28e67829 100644 --- a/src/libsputext/xine_sputext_decoder.c +++ b/src/libsputext/xine_sputext_decoder.c @@ -244,8 +244,9 @@ static void update_output_size (sputext_decoder_t *this) { } } -static int parse_utf8_size(unsigned char *c) +static int parse_utf8_size(const void *buf) { + const uint8_t *c = buf; if ( c[0]<0x80 ) return 1; |