# HG changeset patch # User atlka # Date 1057043799 0 # Node ID ee46cdf03028382e6acd093c2bf9a4d4456588f0 # Parent 536f3ea8d19d82c7e424e96ac38987b3dfedf5a0 small correction of sub_utf8 restoring between reading sub files diff -r 536f3ea8d19d -r ee46cdf03028 subreader.c --- a/subreader.c Mon Jun 30 23:46:08 2003 +0000 +++ b/subreader.c Tue Jul 01 07:16:39 2003 +0000 @@ -1166,6 +1166,17 @@ if(filename==NULL) return NULL; //qnx segfault fd=fopen (filename, "r"); if (!fd) return NULL; + + sub_format=sub_autodetect (fd, &uses_time); + mpsub_multiplier = (uses_time ? 100.0 : 1.0); + if (sub_format==SUB_INVALID) {mp_msg(MSGT_SUBREADER,MSGL_WARN,"SUB: Could not determine file format\n");return NULL;} + srp=sr+sub_format; + mp_msg(MSGT_SUBREADER,MSGL_INFO,"SUB: Detected subtitle file format: %s\n", srp->name); + + rewind (fd); + +#ifdef USE_ICONV + sub_utf8_prev=sub_utf8; { int l; if ((l=strlen(filename))>4){ @@ -1178,17 +1189,7 @@ } } } - sub_format=sub_autodetect (fd, &uses_time); - mpsub_multiplier = (uses_time ? 100.0 : 1.0); - if (sub_format==SUB_INVALID) {mp_msg(MSGT_SUBREADER,MSGL_WARN,"SUB: Could not determine file format\n");return NULL;} - srp=sr+sub_format; - mp_msg(MSGT_SUBREADER,MSGL_INFO,"SUB: Detected subtitle file format: %s\n", srp->name); - - rewind (fd); - -#ifdef USE_ICONV - sub_utf8_prev=sub_utf8; - subcp_open(); + if (!(sub_utf8 & 1)) subcp_open(); #endif sub_num=0;n_max=32;