diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-01-28 18:28:09 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-01-28 18:28:09 +0000 |
commit | 7e5bca4243d0427ceb6705cd0dea033ad253bb2a (patch) | |
tree | 0c51f977b22860f00f51cd9d78ccbe8956d89773 | |
parent | dc2eda37b364cb9933a5b20482aedb333a4ff160 (diff) |
maybe fix ogm vs. iconv
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9144 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | subreader.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/subreader.c b/subreader.c index 35bb69a9be..7e2db174d1 100644 --- a/subreader.c +++ b/subreader.c @@ -934,6 +934,7 @@ void subcp_close (void) { if (icdsc != (iconv_t)(-1)){ (void) iconv_close (icdsc); + icdsc = (iconv_t)(-1); sub_utf8=sub_utf8_prev; mp_msg(MSGT_SUBREADER,MSGL_V,"SUB: closed iconv descriptor.\n"); } @@ -983,18 +984,19 @@ subtitle* subcp_recode1 (subtitle *sub) { int l=sub->lines; size_t ileft, oleft; - char *op, *ip; + + if(icdsc == (iconv_t)(-1)) return sub; while (l){ - ip = icbuffer; - op = sub->text[--l]; + char *ip = icbuffer; + char *op = sub->text[--l]; strcpy(ip, op); ileft = strlen(ip); oleft = ICBUFFSIZE - 1; if (iconv(icdsc, &ip, &ileft, &op, &oleft) == (size_t)(-1)) { - mp_msg(MSGT_SUBREADER,MSGL_WARN,"SUB: error recoding line (2).\n"); + mp_msg(MSGT_SUBREADER,MSGL_V,"SUB: error recoding line (2).\n"); return sub; } *op='\0' ; |