summaryrefslogtreecommitdiffstats
path: root/subreader.c
diff options
context:
space:
mode:
authoratlka <atlka@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-07-01 07:16:39 +0000
committeratlka <atlka@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-07-01 07:16:39 +0000
commit6b4a12daa22903f6fc6010445c0a2ede0b627fa6 (patch)
treeaf6d623c83f103d9d17419ea6738cf4faad82713 /subreader.c
parent6893218fc85bd38e5035065766ba74bd81f9ab5c (diff)
downloadmpv-6b4a12daa22903f6fc6010445c0a2ede0b627fa6.tar.bz2
mpv-6b4a12daa22903f6fc6010445c0a2ede0b627fa6.tar.xz
small correction of sub_utf8 restoring between reading sub files
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10354 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'subreader.c')
-rw-r--r--subreader.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/subreader.c b/subreader.c
index 22fe2f1cdd..e8d24630ff 100644
--- a/subreader.c
+++ b/subreader.c
@@ -1166,6 +1166,17 @@ sub_data* sub_read_file (char *filename, float fps) {
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_data* sub_read_file (char *filename, float fps) {
}
}
}
- 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;