summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-01 22:54:17 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-01 22:54:17 +0000
commitd591cc8aad60a328938690f7aeb0e38d7512a82d (patch)
treef7641dd7437c6c1d4aa5c40831dd823fd23457a3 /mplayer.c
parent0f1fa8e4fced31471b20a26498c542bf7a1120da (diff)
downloadmpv-d591cc8aad60a328938690f7aeb0e38d7512a82d.tar.bz2
mpv-d591cc8aad60a328938690f7aeb0e38d7512a82d.tar.xz
-dumpstream
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3258 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/mplayer.c b/mplayer.c
index ec27e162bb..21773569a2 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -199,7 +199,7 @@ extern int cache_fill_status;
#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 @@ play_next_file:
}
}
-
-
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 @@ play_next_file:
//============ 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(stream_dump_type){
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);