diff options
author | nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-12-18 20:53:40 +0000 |
---|---|---|
committer | nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-12-18 20:53:40 +0000 |
commit | 4dac2f20eb8341fe35370e4ac0574e416724c4b2 (patch) | |
tree | 9c3528b7555ffe7479e354d7fff8c6a7293087e5 | |
parent | 8bd29fd6c5a80372d21694e9c6b56453249aff72 (diff) | |
download | mpv-4dac2f20eb8341fe35370e4ac0574e416724c4b2.tar.bz2 mpv-4dac2f20eb8341fe35370e4ac0574e416724c4b2.tar.xz |
in STREAM_WRITE mode open the stream with O_RDWR|O_CREAT, S_IRUSR|S_IWUSR and disable seek_forward for pipes
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21672 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | stream/stream_file.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/stream/stream_file.c b/stream/stream_file.c index ba2c3b133c..a92cc385b8 100644 --- a/stream/stream_file.c +++ b/stream/stream_file.c @@ -78,7 +78,7 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) { if(mode == STREAM_READ) m = O_RDONLY; else if(mode == STREAM_WRITE) - m = O_WRONLY; + m = O_RDWR|O_CREAT; else { mp_msg(MSGT_OPEN,MSGL_ERR, "[file] Unknown open mode %d\n",mode); m_struct_free(&stream_opts,opts); @@ -117,7 +117,10 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) { #endif } } else { - f=open(filename,m); + if(mode == STREAM_READ) + f=open(filename,m); + else + f=open(filename,m, S_IRUSR|S_IWUSR); if(f<0) { mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_FileNotFound,filename); m_struct_free(&stream_opts,opts); @@ -131,7 +134,7 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) { #else if(len == -1) { #endif - stream->seek = seek_forward; + if(mode == STREAM_READ) stream->seek = seek_forward; stream->type = STREAMTYPE_STREAM; // Must be move to STREAMTYPE_FILE stream->flags |= STREAM_SEEK_FW; } else if(len >= 0) { |