From fd4a7480e74008c0e654ad9bf790a8fa6625e661 Mon Sep 17 00:00:00 2001
From: iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>
Date: Wed, 8 Nov 2006 16:01:00 +0000
Subject: added --overwrite option and updated manpage accordingly

git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@152 f606c939-3180-4ac9-a4b8-4b8779d57d0a
---
 rMD-exp/src/init_encoder.c | 4 ++--
 rMD-exp/src/parseargs.c    | 6 +++++-
 2 files changed, 7 insertions(+), 3 deletions(-)

(limited to 'rMD-exp/src')

diff --git a/rMD-exp/src/init_encoder.c b/rMD-exp/src/init_encoder.c
index 4edfef1..84d36aa 100644
--- a/rMD-exp/src/init_encoder.c
+++ b/rMD-exp/src/init_encoder.c
@@ -66,8 +66,8 @@ void InitEncoder(ProgData *pdata,EncData *enc_data_t,int buffer_ready){
     ogg_stream_init(&(enc_data_t)->m_ogg_ts,y1);
     if(!pdata->args.nosound)
         ogg_stream_init(&(enc_data_t)->m_ogg_vs,y2);
-
-    IncrementalNaming(&(pdata)->args.filename);
+    if(!pdata->args.overwrite)
+        IncrementalNaming(&(pdata)->args.filename);
     (enc_data_t)->fp=fopen((pdata)->args.filename,"w");
     if((enc_data_t)->fp==NULL){
         fprintf(stderr,"Cannot open file %s for writting!\n",(pdata)->args.filename);
diff --git a/rMD-exp/src/parseargs.c b/rMD-exp/src/parseargs.c
index 72a2681..c7d20fd 100644
--- a/rMD-exp/src/parseargs.c
+++ b/rMD-exp/src/parseargs.c
@@ -36,7 +36,7 @@ int ParseArgs(int argc,char **argv,ProgArgs *arg_return){
     "\t -v_quality n| -s_quality n| -v_bitrate n| --no-framedrop| -dummy-cursor color|\n"
     "\t --no-cursor| -freq N(number>0)| -channels N(number>0)| -device SOUND_DEVICE|\n"
     "\t --no-sound| --with-shared| --no-cond-shared| -shared-threshold n| --full-shots|\n"
-    "\t --quick-subsampling| -workdir DIR| --zero-compression| --no-wm-check| -o filename]^filename\n\n\n"
+    "\t --quick-subsampling| -workdir DIR| --zero-compression| --no-wm-check| --overwite| -o filename]^filename\n\n\n"
 
     "General Options:\n"
     "\t-h or --help\t\tPrint this help and exit.\n"
@@ -77,6 +77,8 @@ int ParseArgs(int argc,char **argv,ProgArgs *arg_return){
     "\t--zero-compression\tImage data are always cached uncompressed.\n"
     "\t-workdir DIR\t\tLocation where a temporary directory will be created to hold project files(default $HOME).\n"
     "\t-delay n[H|h|M|m]\tNumber of secs(default),minutes or hours before capture starts(number can be float)\n"
+    "\t--overwrite\t\tIf there is already a file with the same name, delete it\n"
+    "\t\t\t\t(default is to add a number postfix to the new one).\n"
     "\t-o filename\t\tName of recorded video(default out.ogg).\n"
     "\n\tIf no other options are specified, filename can be given without the -o switch.\n\n\n";
 
@@ -399,6 +401,8 @@ int ParseArgs(int argc,char **argv,ProgArgs *arg_return){
         else if(!strcmp(argv[i],"--on-the-fly-encoding")){
             arg_return->encOnTheFly=1;
         }
+        else if(!strcmp(argv[i],"--overwrite"))
+            arg_return->overwrite=1;
         else if(!strcmp(argv[i],"--no-wm-check"))
             arg_return->nowmcheck=1;
         else if(!strcmp(argv[i],"--zero-compression")){
-- 
cgit v1.2.3