summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-05-13 22:45:21 +0000
committerarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-05-13 22:45:21 +0000
commit9cb442ad8dbe0efa8f32be63d8358d29c1b4244b (patch)
tree527dc5081fbf188a8ea8a4948c8179490ac45f39
parent63df914fc517c9f36fe6fac07bf298e2eabae70d (diff)
downloadmpv-9cb442ad8dbe0efa8f32be63d8358d29c1b4244b.tar.bz2
mpv-9cb442ad8dbe0efa8f32be63d8358d29c1b4244b.tar.xz
dump stuff moved before header parsing
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@793 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--mplayer.c64
1 files changed, 33 insertions, 31 deletions
diff --git a/mplayer.c b/mplayer.c
index f7c338ac44..8d31c01d9e 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -914,6 +914,39 @@ switch(file_format){
}
} // switch(file_format)
+// DUMP STREAMS:
+if(stream_dump_type){
+ FILE *f;
+ int len;
+ demux_stream_t *ds=NULL;
+ // select stream to dump
+ switch(stream_dump_type){
+ case 1: ds=d_audio;break;
+ case 2: ds=d_video;break;
+ case 3: ds=d_dvdsub;break;
+ }
+ if(!ds){
+ printf("dump: FATAL: selected stream missing!\n");
+ exit(1);
+ }
+ // disable other streams:
+ if(d_audio && d_audio!=ds) {ds_free_packs(d_audio); d_audio->id=-2; }
+ 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");
+ if(!f){ printf("Can't open dump file!!!\n");exit(1); }
+ while(!ds->eof){
+ unsigned 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);
+}
+
+
// Determine image properties:
switch(file_format){
case DEMUXER_TYPE_AVI:
@@ -1011,37 +1044,6 @@ printf("[V] filefmt:%d fourcc:0x%X size:%dx%d fps:%5.2f ftime:=%6.4f\n",
fflush(stdout);
-if(stream_dump_type){
- FILE *f;
- int len;
- demux_stream_t *ds=NULL;
- // select stream to dump
- switch(stream_dump_type){
- case 1: ds=d_audio;break;
- case 2: ds=d_video;break;
- case 3: ds=d_dvdsub;break;
- }
- if(!ds){
- printf("dump: FATAL: selected stream missing!\n");
- exit(1);
- }
- // disable other streams:
- if(d_audio && d_audio!=ds) {ds_free_packs(d_audio); d_audio->id=-2; }
- 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");
- if(!f){ printf("Can't open dump file!!!\n");exit(1); }
- while(!ds->eof){
- unsigned 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);
-}
-
if(!sh_video){
printf("Sorry, no video stream... it's unplayable yet\n");
exit(1);