diff options
author | lorenm <lorenm@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-03-05 17:42:25 +0000 |
---|---|---|
committer | lorenm <lorenm@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-03-05 17:42:25 +0000 |
commit | 58846451f0e1db00d40d5068250bf9b81a6a5e4e (patch) | |
tree | 57b1a3c706a819f12843fe66da399ab9f3361844 /stream | |
parent | dd866c4d11dfe1f87b32844bc92792e929fb743e (diff) | |
download | mpv-58846451f0e1db00d40d5068250bf9b81a6a5e4e.tar.bz2 mpv-58846451f0e1db00d40d5068250bf9b81a6a5e4e.tar.xz |
truncate mencoder's output file if it exists, instead of overwriting just part of it.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22469 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r-- | stream/stream_file.c | 2 | ||||
-rw-r--r-- | stream/stream_smb.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/stream/stream_file.c b/stream/stream_file.c index aa946c5c14..d9f5cd92e7 100644 --- a/stream/stream_file.c +++ b/stream/stream_file.c @@ -94,7 +94,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_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); diff --git a/stream/stream_smb.c b/stream/stream_smb.c index a9132eda69..c70207ee92 100644 --- a/stream/stream_smb.c +++ b/stream/stream_smb.c @@ -104,7 +104,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) //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); |