Mercurial > mplayer.hg
diff mplayer.c @ 549:c97496b240c1
new options: -dumpaudio and -dumpvideo
author | arpi_esp |
---|---|
date | Fri, 20 Apr 2001 18:28:13 +0000 |
parents | 22ed5f5821e2 |
children | c2a449f90087 |
line wrap: on
line diff
--- a/mplayer.c Fri Apr 20 17:27:38 2001 +0000 +++ b/mplayer.c Fri Apr 20 18:28:13 2001 +0000 @@ -497,6 +497,8 @@ float sub_delay=0; float sub_fps=0; int sub_auto = 1; +char stream_dump_name=NULL; +int stream_dump_type=0; //int user_bpp=0; #include "mixer.h" @@ -929,6 +931,24 @@ fflush(stdout); +if(stream_dump_type){ + FILE *f; + int len; + demux_stream_t *ds=(stream_dump_type==1)?d_audio:d_video; + demux_stream_t *ds2=(stream_dump_type!=1)?d_audio:d_video; + ds_free_packs(ds2); ds2->id=-2; // ignore this stream! + f=fopen(stream_dump_name?stream_dump_name:"stream.dump","wb"); + if(!f){ printf("Can't open dump file!!!\n");exit(1); } + while(!ds->eof){ + char* start; + int in_size=ds_get_packet(ds,&start); + if(in_size>0) fwrite(start,in_size,1,f); + } + fclose(f); + printf("core dumped :)\n"); + exit(1); +} + //================== Init AUDIO (codec) ========================== if(has_audio){ // Go through the codec.conf and find the best codec...