[MPlayer-cvslog] r21672 - trunk/stream/stream_file.c

nicodvb subversion at mplayerhq.hu
Mon Dec 18 21:53:40 CET 2006


Author: nicodvb
Date: Mon Dec 18 21:53:40 2006
New Revision: 21672

Modified:
   trunk/stream/stream_file.c

Log:
in STREAM_WRITE mode open the stream with O_RDWR|O_CREAT, S_IRUSR|S_IWUSR and disable seek_forward for pipes

Modified: trunk/stream/stream_file.c
==============================================================================
--- trunk/stream/stream_file.c	(original)
+++ trunk/stream/stream_file.c	Mon Dec 18 21:53:40 2006
@@ -78,7 +78,7 @@
   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 @@
 #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 @@
 #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) {



More information about the MPlayer-cvslog mailing list