mirror of
https://github.com/mpv-player/mpv
synced 2025-01-03 05:22:23 +00:00
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
This commit is contained in:
parent
6893218fc8
commit
6b4a12daa2
23
subreader.c
23
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;
|
||||
|
Loading…
Reference in New Issue
Block a user