[MPlayer-dev-eng] [PATCH] mencoder exit status

Artur Skawina skawina at geocities.com
Sun Nov 25 02:35:50 CET 2001


mencoder returns success when interrupted w/ eg ^C, which is, hmm, 
not ideal if it's being run by a script that deletes the source files
after transcoding them...
patch below makes it return success only when EOF is actually seen
(ie the whole file has been processed)
-------------- next part --------------
--- main/mencoder.c	Sun Nov 18 22:33:52 2001
+++ main-as/mencoder.c	Sun Nov 25 02:17:54 2001
@@ -220,9 +220,11 @@ int dec_audio(sh_audio_t *sh_audio,unsig
 //---------------------------------------------------------------------------
 
 static int eof=0;
+static int interrupted=0;
 
 static void exit_sighandler(int x){
     eof=1;
+    interrupted=1;
 }
 
 int main(int argc,char* argv[], char *envp[]){
@@ -824,4 +826,5 @@ fclose(muxer_f);
 
 if(stream) free_stream(stream); // kill cache thread
 
+return interrupted;
 }


More information about the MPlayer-dev-eng mailing list