comparison libmpdemux/asfheader.c @ 8027:b9da278e4c92

verbose can be negative
author arpi
date Fri, 01 Nov 2002 17:46:45 +0000
parents e44ec5681211
children ae5a2ae1c349
comparison
equal deleted inserted replaced
8026:b465ba5897a3 8027:b9da278e4c92
149 //printf("0x%08X [%s] %d\n",pos, asf_chunk_type(objh.guid),(int) objh.size); 149 //printf("0x%08X [%s] %d\n",pos, asf_chunk_type(objh.guid),(int) objh.size);
150 switch(ASF_LOAD_GUID_PREFIX(objh.guid)){ 150 switch(ASF_LOAD_GUID_PREFIX(objh.guid)){
151 case ASF_GUID_PREFIX_stream_header: 151 case ASF_GUID_PREFIX_stream_header:
152 stream_read(demuxer->stream,(char*) &streamh,sizeof(streamh)); 152 stream_read(demuxer->stream,(char*) &streamh,sizeof(streamh));
153 le2me_ASF_stream_header_t(&streamh); 153 le2me_ASF_stream_header_t(&streamh);
154 if(verbose){ 154 if(verbose>0){
155 mp_msg(MSGT_HEADER,MSGL_V,"stream type: %s\n",asf_chunk_type(streamh.type)); 155 mp_msg(MSGT_HEADER,MSGL_V,"stream type: %s\n",asf_chunk_type(streamh.type));
156 mp_msg(MSGT_HEADER,MSGL_V,"stream concealment: %s\n",asf_chunk_type(streamh.concealment)); 156 mp_msg(MSGT_HEADER,MSGL_V,"stream concealment: %s\n",asf_chunk_type(streamh.concealment));
157 mp_msg(MSGT_HEADER,MSGL_V,"type: %d bytes, stream: %d bytes ID: %d\n",(int)streamh.type_size,(int)streamh.stream_size,(int)streamh.stream_no); 157 mp_msg(MSGT_HEADER,MSGL_V,"type: %d bytes, stream: %d bytes ID: %d\n",(int)streamh.type_size,(int)streamh.stream_size,(int)streamh.stream_no);
158 mp_msg(MSGT_HEADER,MSGL_V,"unk1: %lX unk2: %X\n",(unsigned long)streamh.unk1,(unsigned int)streamh.unk2); 158 mp_msg(MSGT_HEADER,MSGL_V,"unk1: %lX unk2: %X\n",(unsigned long)streamh.unk1,(unsigned int)streamh.unk2);
159 mp_msg(MSGT_HEADER,MSGL_V,"FILEPOS=0x%X\n",stream_tell(demuxer->stream)); 159 mp_msg(MSGT_HEADER,MSGL_V,"FILEPOS=0x%X\n",stream_tell(demuxer->stream));
231 mp_msg(MSGT_HEADER,MSGL_V,"\n"); 231 mp_msg(MSGT_HEADER,MSGL_V,"\n");
232 // extract the title 232 // extract the title
233 if( contenth.title_size!=0 ) { 233 if( contenth.title_size!=0 ) {
234 string=(char*)malloc(contenth.title_size); 234 string=(char*)malloc(contenth.title_size);
235 stream_read(demuxer->stream, string, contenth.title_size); 235 stream_read(demuxer->stream, string, contenth.title_size);
236 if(verbose) 236 if(verbose>0)
237 print_asf_string(" Title: ", string, contenth.title_size); 237 print_asf_string(" Title: ", string, contenth.title_size);
238 else 238 else
239 pack_asf_string(string, contenth.title_size); 239 pack_asf_string(string, contenth.title_size);
240 demux_info_add(demuxer, "name", string); 240 demux_info_add(demuxer, "name", string);
241 } 241 }
242 // extract the author 242 // extract the author
243 if( contenth.author_size!=0 ) { 243 if( contenth.author_size!=0 ) {
244 string=(char*)realloc((void*)string, contenth.author_size); 244 string=(char*)realloc((void*)string, contenth.author_size);
245 stream_read(demuxer->stream, string, contenth.author_size); 245 stream_read(demuxer->stream, string, contenth.author_size);
246 if(verbose) 246 if(verbose>0)
247 print_asf_string(" Author: ", string, contenth.author_size); 247 print_asf_string(" Author: ", string, contenth.author_size);
248 else 248 else
249 pack_asf_string(string, contenth.author_size); 249 pack_asf_string(string, contenth.author_size);
250 demux_info_add(demuxer, "author", string); 250 demux_info_add(demuxer, "author", string);
251 } 251 }
252 // extract the copyright 252 // extract the copyright
253 if( contenth.copyright_size!=0 ) { 253 if( contenth.copyright_size!=0 ) {
254 string=(char*)realloc((void*)string, contenth.copyright_size); 254 string=(char*)realloc((void*)string, contenth.copyright_size);
255 stream_read(demuxer->stream, string, contenth.copyright_size); 255 stream_read(demuxer->stream, string, contenth.copyright_size);
256 if(verbose) 256 if(verbose>0)
257 print_asf_string(" Copyright: ", string, contenth.copyright_size); 257 print_asf_string(" Copyright: ", string, contenth.copyright_size);
258 else 258 else
259 pack_asf_string(string, contenth.copyright_size); 259 pack_asf_string(string, contenth.copyright_size);
260 demux_info_add(demuxer, "copyright", string); 260 demux_info_add(demuxer, "copyright", string);
261 } 261 }
262 // extract the comment 262 // extract the comment
263 if( contenth.comment_size!=0 ) { 263 if( contenth.comment_size!=0 ) {
264 string=(char*)realloc((void*)string, contenth.comment_size); 264 string=(char*)realloc((void*)string, contenth.comment_size);
265 stream_read(demuxer->stream, string, contenth.comment_size); 265 stream_read(demuxer->stream, string, contenth.comment_size);
266 if(verbose) 266 if(verbose>0)
267 print_asf_string(" Comment: ", string, contenth.comment_size); 267 print_asf_string(" Comment: ", string, contenth.comment_size);
268 else 268 else
269 pack_asf_string(string, contenth.comment_size); 269 pack_asf_string(string, contenth.comment_size);
270 demux_info_add(demuxer, "comments", string); 270 demux_info_add(demuxer, "comments", string);
271 } 271 }
272 // extract the rating 272 // extract the rating
273 if( contenth.rating_size!=0 ) { 273 if( contenth.rating_size!=0 ) {
274 string=(char*)realloc((void*)string, contenth.rating_size); 274 string=(char*)realloc((void*)string, contenth.rating_size);
275 stream_read(demuxer->stream, string, contenth.rating_size); 275 stream_read(demuxer->stream, string, contenth.rating_size);
276 if(verbose) 276 if(verbose>0)
277 print_asf_string(" Rating: ", string, contenth.rating_size); 277 print_asf_string(" Rating: ", string, contenth.rating_size);
278 } 278 }
279 mp_msg(MSGT_HEADER,MSGL_V,"\n"); 279 mp_msg(MSGT_HEADER,MSGL_V,"\n");
280 free(string); 280 free(string);
281 break; 281 break;