changeset 17885:c04102e27eba

if stream is not seekable calling enca would prevent the real parsing of subtitles.
author iive
date Fri, 17 Mar 2006 23:38:46 +0000
parents 0b51810cdf2b
children d526e19c56c3
files subreader.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/subreader.c	Fri Mar 17 19:39:30 2006 +0000
+++ b/subreader.c	Fri Mar 17 23:38:46 2006 +0000
@@ -1086,11 +1086,12 @@
 		int free_cp_tmp = 0;
 		if (sscanf(sub_cp, "enca:%2s:%99s", enca_lang, enca_fallback) == 2
 		     || sscanf(sub_cp, "ENCA:%2s:%99s", enca_lang, enca_fallback) == 2) {
-		  if (st) {
+		  if (st && st->flags & STREAM_SEEK ) {
 		    cp_tmp = guess_cp(st, enca_lang, enca_fallback);
 		    free_cp_tmp = 1;
 		  } else {
 		    cp_tmp = enca_fallback;
+		    mp_msg(MSGT_SUBREADER,MSGL_WARN,"SUB: enca faild, stream must be seakable.\n"); 
 		  }
 		}
 #endif