annotate asfheader.c @ 605:abd7391a31e3

warnings killed
author szabii
date Mon, 23 Apr 2001 23:46:24 +0000
parents 2d3a4339bb5a
children 14a2f35921a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1 // .asf fileformat docs from http://divx.euro.ru
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2
587
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
3
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
4 #include <stdio.h>
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
5 #include <stdlib.h>
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
6
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
7 extern int verbose; // defined in mplayer.c
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
8
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
9 #include "stream.h"
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
10 #include "demuxer.h"
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
11
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
12 #include "wine/mmreg.h"
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
13 #include "wine/avifmt.h"
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
14 #include "wine/vfw.h"
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
15
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
16 #include "codec-cfg.h"
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
17 #include "stheader.h"
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
18
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19 typedef struct __attribute__((packed)) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
20 unsigned char guid[16];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
21 unsigned long long size;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22 } ASF_obj_header_t;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
24 typedef struct __attribute__((packed)) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25 ASF_obj_header_t objh;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
26 unsigned int cno; // number of subchunks
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
27 unsigned char v1; // unknown (0x01)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
28 unsigned char v2; // unknown (0x02)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
29 } ASF_header_t;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
30
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
31 typedef struct __attribute__((packed)) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
32 unsigned char client[16]; // Client GUID
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
33 unsigned long long file_size;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
34 unsigned long long creat_time; //File creation time FILETIME 8
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
35 unsigned long long packets; //Number of packets UINT64 8
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
36 unsigned long long end_timestamp; //Timestamp of the end position UINT64 8
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
37 unsigned long long duration; //Duration of the playback UINT64 8
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
38 unsigned long start_timestamp; //Timestamp of the start position UINT32 4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
39 unsigned long unk1; //Unknown, maybe reserved ( usually contains 0 ) UINT32 4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
40 unsigned long flags; //Unknown, maybe flags ( usually contains 2 ) UINT32 4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41 unsigned long packetsize; //Size of packet, in bytes UINT32 4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42 unsigned long packetsize2; //Size of packet ( confirm ) UINT32 4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
43 unsigned long frame_size; //Size of uncompressed video frame UINT32 4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
44 } ASF_file_header_t;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
46 typedef struct __attribute__((packed)) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
47 unsigned char type[16]; // Stream type (audio/video) GUID 16
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
48 unsigned char concealment[16]; // Audio error concealment type GUID 16
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
49 unsigned long long unk1; // Unknown, maybe reserved ( usually contains 0 ) UINT64 8
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
50 unsigned long type_size; //Total size of type-specific data UINT32 4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
51 unsigned long stream_size; //Size of stream-specific data UINT32 4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
52 unsigned short stream_no; //Stream number UINT16 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
53 unsigned long unk2; //Unknown UINT32 4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
54 } ASF_stream_header_t;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
55
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
56
587
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
57 static ASF_header_t asfh;
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
58 static ASF_obj_header_t objh;
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
59 static ASF_file_header_t fileh;
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
60 static ASF_stream_header_t streamh;
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
61
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62 unsigned char* asf_packet=NULL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63 int asf_scrambling_h=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64 int asf_scrambling_w=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65 int asf_scrambling_b=1;
587
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
66 int asf_packetsize=0;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
67
587
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
68 //int i;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
69
587
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
70
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
71 static char* asf_chunk_type(unsigned char* guid){
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
72 switch(*((unsigned int*)guid)){
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
73 case 0xF8699E40: return "guid_audio_stream";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
74 case 0xBC19EFC0: return "guid_video_stream";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
75 case 0x49f1a440: return "guid_audio_conceal_none";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
76 case 0xbfc3cd50: return "guid_audio_conceal_interleave";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
77 case 0x75B22630: return "guid_header";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
78 case 0x75b22636: return "guid_data_chunk";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
79 case 0x33000890: return "guid_index_chunk";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
80 case 0xB7DC0791: return "guid_stream_header";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
81 case 0xD6E229D1: return "guid_header_2_0";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
82 case 0x8CABDCA1: return "guid_file_header";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
83 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
84 return NULL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
85 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
86
587
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
87 int asf_check_header(demuxer_t *demuxer){
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
88 unsigned char asfhdrguid[16]={0x30,0x26,0xB2,0x75,0x8E,0x66,0xCF,0x11,0xA6,0xD9,0x00,0xAA,0x00,0x62,0xCE,0x6C};
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
89 stream_read(demuxer->stream,(char*) &asfh,sizeof(asfh)); // header obj
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
90 // for(i=0;i<16;i++) printf(" %02X",temp[i]);printf("\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
91 // for(i=0;i<16;i++) printf(" %02X",asfhdrguid[i]);printf("\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
92 if(memcmp(asfhdrguid,asfh.objh.guid,16)){
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
93 if(verbose) printf("ASF_check: not ASF guid!\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
94 return 0; // not ASF guid
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
95 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
96 if(asfh.cno>256){
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
97 if(verbose) printf("ASF_check: invalid subchunks_no %d\n",(int) asfh.cno);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
98 return 0; // invalid header???
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
99 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
100 return 1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
101 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
102
601
2d3a4339bb5a warnings killed
szabii
parents: 600
diff changeset
103 extern void print_wave_header(WAVEFORMATEX *h);
2d3a4339bb5a warnings killed
szabii
parents: 600
diff changeset
104 extern void print_video_header(BITMAPINFOHEADER *h);
2d3a4339bb5a warnings killed
szabii
parents: 600
diff changeset
105
587
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
106 int read_asf_header(demuxer_t *demuxer){
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
107 unsigned char buffer[512];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
108
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
109 #if 1
340
1f7c824033fb less, and more informal printfs
arpi_esp
parents: 291
diff changeset
110 //printf("ASF file! (subchunks: %d)\n",asfh.cno);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
111 while(!stream_eof(demuxer->stream)){
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
112 int pos,endpos;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
113 pos=stream_tell(demuxer->stream);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
114 stream_read(demuxer->stream,(char*) &objh,sizeof(objh));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
115 if(stream_eof(demuxer->stream)) break; // EOF
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
116 endpos=pos+objh.size;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
117 // for(i=0;i<16;i++) printf("%02X ",objh.guid[i]);
340
1f7c824033fb less, and more informal printfs
arpi_esp
parents: 291
diff changeset
118 //printf("0x%08X [%s] %d\n",pos, asf_chunk_type(objh.guid),(int) objh.size);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
119 switch(*((unsigned int*)&objh.guid)){
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
120 case 0xB7DC0791: // guid_stream_header
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
121 stream_read(demuxer->stream,(char*) &streamh,sizeof(streamh));
340
1f7c824033fb less, and more informal printfs
arpi_esp
parents: 291
diff changeset
122 if(verbose){
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
123 printf("stream type: %s\n",asf_chunk_type(streamh.type));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
124 printf("stream concealment: %s\n",asf_chunk_type(streamh.concealment));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
125 printf("type: %d bytes, stream: %d bytes ID: %d\n",(int)streamh.type_size,(int)streamh.stream_size,(int)streamh.stream_no);
600
ef932c18cb14 some warnings have gone
szabii
parents: 587
diff changeset
126 printf("unk1: %lX unk2: %X\n",(unsigned long)streamh.unk1,(unsigned int)streamh.unk2);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
127 printf("FILEPOS=0x%X\n",stream_tell(demuxer->stream));
340
1f7c824033fb less, and more informal printfs
arpi_esp
parents: 291
diff changeset
128 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
129 // type-specific data:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
130 stream_read(demuxer->stream,(char*) buffer,streamh.type_size);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
131 switch(*((unsigned int*)&streamh.type)){
291
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents: 109
diff changeset
132 case 0xF8699E40: { // guid_audio_stream
426
26e513f392b2 new stream selection code
arpi_esp
parents: 340
diff changeset
133 sh_audio_t* sh_audio=new_sh_audio(streamh.stream_no & 0x7F);
432
5251b0c57e39 sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents: 426
diff changeset
134 sh_audio->wf=calloc((streamh.type_size<sizeof(WAVEFORMATEX))?sizeof(WAVEFORMATEX):streamh.type_size,1);
5251b0c57e39 sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents: 426
diff changeset
135 memcpy(sh_audio->wf,buffer,streamh.type_size);
5251b0c57e39 sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents: 426
diff changeset
136 if(verbose>=1) print_wave_header(sh_audio->wf);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
137 if((*((unsigned int*)&streamh.concealment))==0xbfc3cd50){
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
138 stream_read(demuxer->stream,(char*) buffer,streamh.stream_size);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
139 asf_scrambling_h=buffer[0];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
140 asf_scrambling_w=(buffer[2]<<8)|buffer[1];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
141 asf_scrambling_b=(buffer[4]<<8)|buffer[3];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
142 asf_scrambling_w/=asf_scrambling_b;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
143 } else {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
144 asf_scrambling_b=asf_scrambling_h=asf_scrambling_w=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
145 }
340
1f7c824033fb less, and more informal printfs
arpi_esp
parents: 291
diff changeset
146 printf("ASF: audio scrambling: %d x %d x %d\n",asf_scrambling_h,asf_scrambling_w,asf_scrambling_b);
426
26e513f392b2 new stream selection code
arpi_esp
parents: 340
diff changeset
147 //if(demuxer->audio->id==-1) demuxer->audio->id=streamh.stream_no & 0x7F;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
148 break;
291
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents: 109
diff changeset
149 }
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents: 109
diff changeset
150 case 0xBC19EFC0: { // guid_video_stream
426
26e513f392b2 new stream selection code
arpi_esp
parents: 340
diff changeset
151 sh_video_t* sh_video=new_sh_video(streamh.stream_no & 0x7F);
432
5251b0c57e39 sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents: 426
diff changeset
152 int len=streamh.type_size-(4+4+1+2);
5251b0c57e39 sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents: 426
diff changeset
153 // sh_video->bih=malloc(chunksize); memset(sh_video->bih,0,chunksize);
5251b0c57e39 sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents: 426
diff changeset
154 sh_video->bih=calloc((len<sizeof(BITMAPINFOHEADER))?sizeof(BITMAPINFOHEADER):len,1);
5251b0c57e39 sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents: 426
diff changeset
155 memcpy(sh_video->bih,&buffer[4+4+1+2],len);
426
26e513f392b2 new stream selection code
arpi_esp
parents: 340
diff changeset
156 //sh_video->fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale;
26e513f392b2 new stream selection code
arpi_esp
parents: 340
diff changeset
157 //sh_video->frametime=(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
432
5251b0c57e39 sh_audio->wf and sh_video->bih changed to dynamic (thanx to Jens Hoffmann)
arpi_esp
parents: 426
diff changeset
158 if(verbose>=1) print_video_header(sh_video->bih);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
159 //asf_video_id=streamh.stream_no & 0x7F;
426
26e513f392b2 new stream selection code
arpi_esp
parents: 340
diff changeset
160 //if(demuxer->video->id==-1) demuxer->video->id=streamh.stream_no & 0x7F;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
161 break;
291
da98e96499bb sh_audio/sh_video added, general codec cleanup
arpi_esp
parents: 109
diff changeset
162 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
163 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
164 // stream-specific data:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
165 // stream_read(demuxer->stream,(char*) buffer,streamh.stream_size);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
166 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
167 // case 0xD6E229D1: return "guid_header_2_0";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
168 case 0x8CABDCA1: // guid_file_header
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
169 stream_read(demuxer->stream,(char*) &fileh,sizeof(fileh));
340
1f7c824033fb less, and more informal printfs
arpi_esp
parents: 291
diff changeset
170 if(verbose) printf("ASF: packets: %d flags: %d pack_size: %d frame_size: %d\n",(int)fileh.packets,(int)fileh.flags,(int)fileh.packetsize,(int)fileh.frame_size);
587
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
171 asf_packetsize=fileh.packetsize;
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
172 asf_packet=malloc(asf_packetsize); // !!!
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
173 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
174 case 0x75b22636: // guid_data_chunk
587
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
175 demuxer->movi_start=stream_tell(demuxer->stream)+26;
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
176 demuxer->movi_end=endpos;
8511095c5283 stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents: 432
diff changeset
177 if(verbose>=1) printf("Found movie at 0x%X - 0x%X\n",demuxer->movi_start,demuxer->movi_end);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
178 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
179
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
180 // case 0x33000890: return "guid_index_chunk";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
181
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
182 } // switch GUID
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
183 if(!stream_seek(demuxer->stream,endpos)) break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
184 } // while EOF
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
185
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
186 #if 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
187 if(verbose){
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
188 printf("ASF duration: %d\n",(int)fileh.duration);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
189 printf("ASF start pts: %d\n",(int)fileh.start_timestamp);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
190 printf("ASF end pts: %d\n",(int)fileh.end_timestamp);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
191 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
192 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
193
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
194 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
195 return 1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
196 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
197