From c4f83ac6e93ec9ff2fe97b3f5c6fccc9751fa3e2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 7 Jul 2013 20:49:15 +0200 Subject: stream: remove weird STREAMTYPE_STREAM special handling This was an old leftover from an earlier cleanup (which happened in 2003), and which used "special" stuff for streams that could be only forward-seeked. Also, don't add mode flags to s->flags; they're supposed to be in s->mode instead. --- stream/stream_file.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'stream/stream_file.c') diff --git a/stream/stream_file.c b/stream/stream_file.c index 5797aef59f..924eb31dad 100644 --- a/stream/stream_file.c +++ b/stream/stream_file.c @@ -191,14 +191,13 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) { if(f==0) len = -1; #endif - if(len == -1) { - if(mode == STREAM_READ) stream->seek = seek_forward; - stream->type = STREAMTYPE_STREAM; // Must be move to STREAMTYPE_FILE - stream->flags |= MP_STREAM_SEEK_FW; + stream->type = STREAMTYPE_FILE; + if(len == -1 && mode == STREAM_READ) { + stream->seek = seek_forward; + stream->flags = MP_STREAM_SEEK_FW; } else if(len >= 0) { stream->seek = seek; stream->end_pos = len; - stream->type = STREAMTYPE_FILE; } mp_msg(MSGT_OPEN,MSGL_V,"[file] File size is %"PRId64" bytes\n", (int64_t)len); -- cgit v1.2.3