From 1c35794efd7d025457e527b61f7c23fe375c2f5a Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 6 Jun 2013 20:39:58 +0200 Subject: stream: remove stream_reset() This function was called in various places. Most time, it was used before a seek. In other cases, the purpose was apparently resetting the EOF flag. As far as I can see, this makes no sense anymore. At least the stream_reset() calls paired with stream_seek() are completely pointless. A seek will either seek inside the buffer (and reset the EOF flag), or do an actual seek and reset all state. --- sub/subreader.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'sub') diff --git a/sub/subreader.c b/sub/subreader.c index 8c5a259196..f3821ba5ab 100644 --- a/sub/subreader.c +++ b/sub/subreader.c @@ -1212,7 +1212,6 @@ static const char* guess_cp(stream_t *st, const char *preferred_language, const detected_sub_cp = guess_buffer_cp(buffer, buflen, preferred_language, fallback); free(buffer); - stream_reset(st); stream_seek(st,0); return detected_sub_cp; @@ -1255,7 +1254,6 @@ sub_data* sub_read_file(char *filename, float fps, struct MPOpts *opts) int sub_format = SUB_INVALID; for (utf16 = 0; sub_format == SUB_INVALID && utf16 < 3; utf16++) { sub_format=sub_autodetect (fd, &uses_time, utf16); - stream_reset(fd); stream_seek(fd,0); } utf16--; -- cgit v1.2.3