aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-28 01:02:24 +0000
committerGravatar diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-28 01:02:24 +0000
commit78020885a7bec0a871c0522bcb691cbfd7862333 (patch)
tree8df2e05f1d631842055649848533e0080f4038fe
parent7888b27b6fce62c80ce73e990eeacae20f4e9b39 (diff)
Remove hardcoded filenames in favor of command line parameters, some error
checking added, patch by Reza Jelveh. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13785 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--TOOLS/vivodump.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/TOOLS/vivodump.c b/TOOLS/vivodump.c
index cce762c566..9896dacb21 100644
--- a/TOOLS/vivodump.c
+++ b/TOOLS/vivodump.c
@@ -151,15 +151,15 @@ int h263_decode_picture_header(unsigned char *b_ptr)
int postable[32768];
-int main(){
+int main(int argv,char ** argc){
int c;
unsigned int head=-1;
int pos=0;
int frames=0;
-FILE *f=fopen("paulvandykforanangel.viv","rb");
-FILE *f2=fopen("GB1.avi","wb");
-muxer_t* avi=muxer_new_muxer(MUXER_TYPE_AVI,f2);
-muxer_stream_t* mux=muxer_new_stream(avi,MUXER_TYPE_VIDEO);
+FILE *f;
+FILE *f2;
+muxer_t* avi;
+muxer_stream_t* mux;
//unsigned char* buffer=malloc(0x200000);
int i,len;
int v_id=0;
@@ -167,6 +167,20 @@ int flag=0;
int flag2=0;
int prefix=0;
+// input
+if(!(f=fopen(argc[1],"rb"))){
+ printf("Couldn't open input file.\n");
+ return -1;
+}
+// output
+if(!(f2=fopen(argc[2],"wb"))){
+ printf("Couldn't open output file.\n");
+ return -1;
+}
+
+avi=muxer_new_muxer(MUXER_TYPE_AVI,f2);
+mux=muxer_new_stream(avi,MUXER_TYPE_VIDEO);
+
mux->buffer_size=0x200000;
mux->buffer=malloc(mux->buffer_size);