changeset 22451:86f7b9cab33b

truncate mencoder's output file if it exists, instead of overwriting just part of it.
author lorenm
date Mon, 05 Mar 2007 17:42:25 +0000
parents e466ca5fb2c1
children 2e26b94e0c62
files stream/stream_file.c stream/stream_smb.c
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_file.c	Mon Mar 05 13:29:06 2007 +0000
+++ b/stream/stream_file.c	Mon Mar 05 17:42:25 2007 +0000
@@ -94,7 +94,7 @@
   if(mode == STREAM_READ)
     m = O_RDONLY;
   else if(mode == STREAM_WRITE)
-    m = O_RDWR|O_CREAT;
+    m = O_RDWR|O_CREAT|O_TRUNC;
   else {
     mp_msg(MSGT_OPEN,MSGL_ERR, "[file] Unknown open mode %d\n",mode);
     m_struct_free(&stream_opts,opts);
--- a/stream/stream_smb.c	Mon Mar 05 13:29:06 2007 +0000
+++ b/stream/stream_smb.c	Mon Mar 05 17:42:25 2007 +0000
@@ -104,7 +104,7 @@
   if(mode == STREAM_READ)
     m = O_RDONLY;
   else if (mode == STREAM_WRITE) //who's gonna do that ?
-    m = O_RDWR|O_CREAT;
+    m = O_RDWR|O_CREAT|O_TRUNC;
   else {
     mp_msg(MSGT_OPEN, MSGL_ERR, "[smb] Unknown open mode %d\n", mode);
     m_struct_free (&stream_opts, opts);