Mercurial > mplayer.hg
annotate asfheader.c @ 833:b8cecdc0c67f
Starting implementation of ASF network streaming.
author | bertrand |
---|---|
date | Fri, 18 May 2001 16:14:06 +0000 |
parents | 6d72528d56ff |
children | fdce0d25bbfa |
rev | line source |
---|---|
1 | 1 // .asf fileformat docs from http://divx.euro.ru |
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 |
833 | 19 #include "asf.h" |
20 | |
21 // BB: Moved to asf.h --------------------- FROM HERE ------------------- | |
22 #ifdef 0 | |
1 | 23 typedef struct __attribute__((packed)) { |
24 unsigned char guid[16]; | |
25 unsigned long long size; | |
26 } ASF_obj_header_t; | |
27 | |
28 typedef struct __attribute__((packed)) { | |
29 ASF_obj_header_t objh; | |
30 unsigned int cno; // number of subchunks | |
31 unsigned char v1; // unknown (0x01) | |
32 unsigned char v2; // unknown (0x02) | |
33 } ASF_header_t; | |
34 | |
35 typedef struct __attribute__((packed)) { | |
36 unsigned char client[16]; // Client GUID | |
37 unsigned long long file_size; | |
38 unsigned long long creat_time; //File creation time FILETIME 8 | |
39 unsigned long long packets; //Number of packets UINT64 8 | |
40 unsigned long long end_timestamp; //Timestamp of the end position UINT64 8 | |
41 unsigned long long duration; //Duration of the playback UINT64 8 | |
42 unsigned long start_timestamp; //Timestamp of the start position UINT32 4 | |
43 unsigned long unk1; //Unknown, maybe reserved ( usually contains 0 ) UINT32 4 | |
44 unsigned long flags; //Unknown, maybe flags ( usually contains 2 ) UINT32 4 | |
45 unsigned long packetsize; //Size of packet, in bytes UINT32 4 | |
46 unsigned long packetsize2; //Size of packet ( confirm ) UINT32 4 | |
47 unsigned long frame_size; //Size of uncompressed video frame UINT32 4 | |
48 } ASF_file_header_t; | |
49 | |
50 typedef struct __attribute__((packed)) { | |
51 unsigned char type[16]; // Stream type (audio/video) GUID 16 | |
52 unsigned char concealment[16]; // Audio error concealment type GUID 16 | |
53 unsigned long long unk1; // Unknown, maybe reserved ( usually contains 0 ) UINT64 8 | |
54 unsigned long type_size; //Total size of type-specific data UINT32 4 | |
55 unsigned long stream_size; //Size of stream-specific data UINT32 4 | |
56 unsigned short stream_no; //Stream number UINT16 2 | |
57 unsigned long unk2; //Unknown UINT32 4 | |
58 } ASF_stream_header_t; | |
59 | |
816
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
60 typedef struct __attribute__((packed)) { |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
61 unsigned short title_size; |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
62 unsigned short author_size; |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
63 unsigned short copyright_size; |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
64 unsigned short comment_size; |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
65 unsigned short rating_size; |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
66 } ASF_content_description_t; |
833 | 67 #endif |
68 // BB: Moved to asf.h --------------------- TO HERE ------------------- | |
1 | 69 |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
70 static ASF_header_t asfh; |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
71 static ASF_obj_header_t objh; |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
72 static ASF_file_header_t fileh; |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
73 static ASF_stream_header_t streamh; |
816
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
74 static ASF_content_description_t contenth; |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
75 |
1 | 76 unsigned char* asf_packet=NULL; |
77 int asf_scrambling_h=1; | |
78 int asf_scrambling_w=1; | |
79 int asf_scrambling_b=1; | |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
80 int asf_packetsize=0; |
1 | 81 |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
82 //int i; |
1 | 83 |
833 | 84 // the variable string is modify in this function |
85 void pack_asf_string(char* string, int length) { | |
86 int i,j; | |
87 for( i=0, j=0; i<length && string[i]!='\0'; i+=2, j++) { | |
88 string[j]=string[i]; | |
816
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
89 } |
833 | 90 string[j]='\0'; |
91 } | |
92 | |
93 // the variable string is modify in this function | |
94 void print_asf_string(const char* name, char* string, int length) { | |
95 pack_asf_string(string, length); | |
96 printf("%s%s\n", name, string); | |
816
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
97 } |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
98 |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
99 static char* asf_chunk_type(unsigned char* guid){ |
1 | 100 switch(*((unsigned int*)guid)){ |
101 case 0xF8699E40: return "guid_audio_stream"; | |
102 case 0xBC19EFC0: return "guid_video_stream"; | |
103 case 0x49f1a440: return "guid_audio_conceal_none"; | |
104 case 0xbfc3cd50: return "guid_audio_conceal_interleave"; | |
105 case 0x75B22630: return "guid_header"; | |
106 case 0x75b22636: return "guid_data_chunk"; | |
107 case 0x33000890: return "guid_index_chunk"; | |
108 case 0xB7DC0791: return "guid_stream_header"; | |
109 case 0xD6E229D1: return "guid_header_2_0"; | |
110 case 0x8CABDCA1: return "guid_file_header"; | |
111 } | |
112 return NULL; | |
113 } | |
114 | |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
115 int asf_check_header(demuxer_t *demuxer){ |
1 | 116 unsigned char asfhdrguid[16]={0x30,0x26,0xB2,0x75,0x8E,0x66,0xCF,0x11,0xA6,0xD9,0x00,0xAA,0x00,0x62,0xCE,0x6C}; |
117 stream_read(demuxer->stream,(char*) &asfh,sizeof(asfh)); // header obj | |
118 // for(i=0;i<16;i++) printf(" %02X",temp[i]);printf("\n"); | |
119 // for(i=0;i<16;i++) printf(" %02X",asfhdrguid[i]);printf("\n"); | |
120 if(memcmp(asfhdrguid,asfh.objh.guid,16)){ | |
121 if(verbose) printf("ASF_check: not ASF guid!\n"); | |
122 return 0; // not ASF guid | |
123 } | |
124 if(asfh.cno>256){ | |
125 if(verbose) printf("ASF_check: invalid subchunks_no %d\n",(int) asfh.cno); | |
126 return 0; // invalid header??? | |
127 } | |
128 return 1; | |
129 } | |
130 | |
601 | 131 extern void print_wave_header(WAVEFORMATEX *h); |
132 extern void print_video_header(BITMAPINFOHEADER *h); | |
133 | |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
134 int read_asf_header(demuxer_t *demuxer){ |
816
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
135 static unsigned char buffer[1024]; |
1 | 136 |
137 #if 1 | |
340 | 138 //printf("ASF file! (subchunks: %d)\n",asfh.cno); |
1 | 139 while(!stream_eof(demuxer->stream)){ |
140 int pos,endpos; | |
141 pos=stream_tell(demuxer->stream); | |
142 stream_read(demuxer->stream,(char*) &objh,sizeof(objh)); | |
143 if(stream_eof(demuxer->stream)) break; // EOF | |
144 endpos=pos+objh.size; | |
145 // for(i=0;i<16;i++) printf("%02X ",objh.guid[i]); | |
340 | 146 //printf("0x%08X [%s] %d\n",pos, asf_chunk_type(objh.guid),(int) objh.size); |
1 | 147 switch(*((unsigned int*)&objh.guid)){ |
148 case 0xB7DC0791: // guid_stream_header | |
149 stream_read(demuxer->stream,(char*) &streamh,sizeof(streamh)); | |
340 | 150 if(verbose){ |
1 | 151 printf("stream type: %s\n",asf_chunk_type(streamh.type)); |
152 printf("stream concealment: %s\n",asf_chunk_type(streamh.concealment)); | |
153 printf("type: %d bytes, stream: %d bytes ID: %d\n",(int)streamh.type_size,(int)streamh.stream_size,(int)streamh.stream_no); | |
600 | 154 printf("unk1: %lX unk2: %X\n",(unsigned long)streamh.unk1,(unsigned int)streamh.unk2); |
1 | 155 printf("FILEPOS=0x%X\n",stream_tell(demuxer->stream)); |
340 | 156 } |
816
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
157 if(streamh.type_size>1024 || streamh.stream_size>1024){ |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
158 printf("FATAL: header size bigger than 1024 bytes!\n"); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
159 printf("Please contact mplayer authors, and upload/send this file.\n"); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
160 exit(1); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
161 } |
1 | 162 // type-specific data: |
163 stream_read(demuxer->stream,(char*) buffer,streamh.type_size); | |
164 switch(*((unsigned int*)&streamh.type)){ | |
291 | 165 case 0xF8699E40: { // guid_audio_stream |
426 | 166 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
|
167 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
|
168 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
|
169 if(verbose>=1) print_wave_header(sh_audio->wf); |
1 | 170 if((*((unsigned int*)&streamh.concealment))==0xbfc3cd50){ |
171 stream_read(demuxer->stream,(char*) buffer,streamh.stream_size); | |
172 asf_scrambling_h=buffer[0]; | |
173 asf_scrambling_w=(buffer[2]<<8)|buffer[1]; | |
174 asf_scrambling_b=(buffer[4]<<8)|buffer[3]; | |
175 asf_scrambling_w/=asf_scrambling_b; | |
176 } else { | |
177 asf_scrambling_b=asf_scrambling_h=asf_scrambling_w=1; | |
178 } | |
340 | 179 printf("ASF: audio scrambling: %d x %d x %d\n",asf_scrambling_h,asf_scrambling_w,asf_scrambling_b); |
426 | 180 //if(demuxer->audio->id==-1) demuxer->audio->id=streamh.stream_no & 0x7F; |
1 | 181 break; |
291 | 182 } |
183 case 0xBC19EFC0: { // guid_video_stream | |
426 | 184 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
|
185 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
|
186 // 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
|
187 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
|
188 memcpy(sh_video->bih,&buffer[4+4+1+2],len); |
426 | 189 //sh_video->fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale; |
190 //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
|
191 if(verbose>=1) print_video_header(sh_video->bih); |
1 | 192 //asf_video_id=streamh.stream_no & 0x7F; |
426 | 193 //if(demuxer->video->id==-1) demuxer->video->id=streamh.stream_no & 0x7F; |
1 | 194 break; |
291 | 195 } |
1 | 196 } |
197 // stream-specific data: | |
198 // stream_read(demuxer->stream,(char*) buffer,streamh.stream_size); | |
199 break; | |
200 // case 0xD6E229D1: return "guid_header_2_0"; | |
201 case 0x8CABDCA1: // guid_file_header | |
202 stream_read(demuxer->stream,(char*) &fileh,sizeof(fileh)); | |
340 | 203 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
|
204 asf_packetsize=fileh.packetsize; |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
205 asf_packet=malloc(asf_packetsize); // !!! |
1 | 206 break; |
207 case 0x75b22636: // guid_data_chunk | |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
208 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
|
209 demuxer->movi_end=endpos; |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
432
diff
changeset
|
210 if(verbose>=1) printf("Found movie at 0x%X - 0x%X\n",demuxer->movi_start,demuxer->movi_end); |
1 | 211 break; |
212 | |
213 // case 0x33000890: return "guid_index_chunk"; | |
214 | |
816
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
215 case 0x75b22633: // Content description |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
216 stream_read(demuxer->stream,(char*) &contenth,sizeof(contenth)); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
217 { |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
218 char *string; |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
219 // extract the title |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
220 string=(char*)malloc(contenth.title_size); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
221 stream_read(demuxer->stream, string, contenth.title_size); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
222 print_asf_string("\n Title: ", string, contenth.title_size); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
223 // extract the author |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
224 string=(char*)realloc((void*)string, contenth.author_size); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
225 stream_read(demuxer->stream, string, contenth.author_size); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
226 print_asf_string(" Author: ", string, contenth.author_size); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
227 // extract the copyright |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
228 string=(char*)realloc((void*)string, contenth.copyright_size); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
229 stream_read(demuxer->stream, string, contenth.copyright_size); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
230 print_asf_string(" Copyright: ", string, contenth.copyright_size); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
231 // extract the comment |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
232 string=(char*)realloc((void*)string, contenth.comment_size); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
233 stream_read(demuxer->stream, string, contenth.comment_size); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
234 print_asf_string(" Comment: ", string, contenth.comment_size); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
235 // extract the rating |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
236 string=(char*)realloc((void*)string, contenth.rating_size); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
237 stream_read(demuxer->stream, string, contenth.rating_size); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
238 print_asf_string(" Rating: ", string, contenth.rating_size); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
239 printf("\n"); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
240 free(string); |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
241 } |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
242 break; |
6d72528d56ff
ASF description printing patch by Bertrand BAUDET, fixed segfault of hory_bug/a.asf
arpi_esp
parents:
692
diff
changeset
|
243 |
1 | 244 } // switch GUID |
692 | 245 |
246 if((*((unsigned int*)&objh.guid))==0x75b22636) break; // movi chunk | |
247 | |
1 | 248 if(!stream_seek(demuxer->stream,endpos)) break; |
249 } // while EOF | |
250 | |
251 #if 0 | |
252 if(verbose){ | |
253 printf("ASF duration: %d\n",(int)fileh.duration); | |
254 printf("ASF start pts: %d\n",(int)fileh.start_timestamp); | |
255 printf("ASF end pts: %d\n",(int)fileh.end_timestamp); | |
256 } | |
257 #endif | |
258 | |
259 #endif | |
260 return 1; | |
261 } |