[Mplayer-cvslog] CVS: main mplayer.c,1.331,1.332 cfg-mplayer.h,1.106,1.107

Arpi of Ize arpi at mplayer.dev.hu
Sat Dec 1 23:54:20 CET 2001


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv14414

Modified Files:
	mplayer.c cfg-mplayer.h 
Log Message:
-dumpstream

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.331
retrieving revision 1.332
diff -u -r1.331 -r1.332
--- mplayer.c	30 Nov 2001 23:44:04 -0000	1.331
+++ mplayer.c	1 Dec 2001 22:54:17 -0000	1.332
@@ -199,7 +199,7 @@
 #endif
 
 // dump:
-static char *stream_dump_name=NULL;
+static char *stream_dump_name="stream.dump";
 static int stream_dump_type=0;
 
 // A-V sync:
@@ -775,14 +775,34 @@
     }
   }
 
-    
-
   current_module="open_stream";
   stream=open_stream(filename,vcd_track,&file_format);
   if(!stream) goto goto_next_file;//  exit_player(MSGTR_Exit_error); // error...
   inited_flags|=INITED_STREAM;
   stream->start_pos+=seek_to_byte;
 
+if(stream_dump_type==5){
+  unsigned char buf[4096];
+  int len;
+  FILE *f;
+  current_module="dump";
+  stream_reset(stream);
+  stream_seek(stream,stream->start_pos);
+  f=fopen(stream_dump_name,"wb");
+  if(!f){
+    mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_CantOpenDumpfile);
+    exit_player(MSGTR_Exit_error);
+  }
+  while(!stream->eof){
+      len=stream_read(stream,buf,4096);
+      if(len>0) fwrite(buf,len,1,f);
+  }
+  fclose(f);
+  mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_CoreDumped);
+  exit_player(MSGTR_Exit_eof);
+}
+
+
 #ifdef USE_DVDREAD
   current_module="spudec";
   vo_spudec=spudec_new(stream->priv);
@@ -816,6 +836,7 @@
 
 //============ Open & Sync stream and detect file format ===============
 
+
 if(!has_audio) audio_id=-2; // do NOT read audio packets...
 
 current_module="demux_open";
@@ -850,7 +871,7 @@
   if(d_video && d_video!=ds) {ds_free_packs(d_video); d_video->id=-2; }
   if(d_dvdsub && d_dvdsub!=ds) {ds_free_packs(d_dvdsub); d_dvdsub->id=-2; }
   // let's dump it!
-  f=fopen(stream_dump_name?stream_dump_name:"stream.dump","wb");
+  f=fopen(stream_dump_name,"wb");
   if(!f){
     mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_CantOpenDumpfile);
     exit_player(MSGTR_Exit_error);

Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -r1.106 -r1.107
--- cfg-mplayer.h	29 Nov 2001 12:44:00 -0000	1.106
+++ cfg-mplayer.h	1 Dec 2001 22:54:17 -0000	1.107
@@ -164,6 +164,7 @@
 	{"dumpvideo", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 2},
 	{"dumpsub", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 3},
 	{"dumpmpsub", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 4},
+	{"dumpstream", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 5},
 
 	{"aofile", &ao_outputfilename, CONF_TYPE_STRING, 0, 0, 0},
 	{"waveheader", &ao_pcm_waveheader, CONF_TYPE_FLAG, 0, 0, 1},




More information about the MPlayer-cvslog mailing list