changeset 9143:6af323788366

maybe fix ogm vs. iconv
author arpi
date Tue, 28 Jan 2003 18:28:09 +0000
parents a540a2632da1
children d33fe13de7ae
files subreader.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/subreader.c	Tue Jan 28 17:44:31 2003 +0000
+++ b/subreader.c	Tue Jan 28 18:28:09 2003 +0000
@@ -934,6 +934,7 @@
 {
 	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 @@
 {
   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' ;