void vorbis_info_clear(vorbis_info *vi) { codec_setup_info *ci = (codec_setup_info *) vi->codec_setup; int i; if(ci) { for(i=0; i<ci->modes; i++) { if(ci->mode_param[i]) { _ogg_free(ci->mode_param[i]); } } for(i=0; i<ci->maps; i++) /* unpack does the range checking */ { _mapping_P[ci->map_type[i]]->free_info(ci->map_param[i]); } for(i=0; i<ci->floors; i++) /* unpack does the range checking */ { _floor_P[ci->floor_type[i]]->free_info(ci->floor_param[i]); } for(i=0; i<ci->residues; i++) /* unpack does the range checking */ { _residue_P[ci->residue_type[i]]->free_info(ci->residue_param[i]); } for(i=0; i<ci->books; i++) { if(ci->book_param[i]) { /* knows if the book was not alloced */ vorbis_staticbook_destroy(ci->book_param[i]); } if(ci->fullbooks) { vorbis_book_clear(ci->fullbooks+i); } } if(ci->fullbooks) { _ogg_free(ci->fullbooks); } for(i=0; i<ci->psys; i++) { _vi_psy_free(ci->psy_param[i]); } _ogg_free(ci); } memset(vi,0,sizeof(*vi)); }
void vorbis_info_clear(vorbis_info *vi){ codec_setup_info *ci=vi->codec_setup; int i; if(ci){ for(i=0;i<ci->modes;i++) if(ci->mode_param[i])_ogg_free(ci->mode_param[i]); for(i=0;i<ci->maps;i++) /* unpack does the range checking */ if(ci->map_param[i]) /* this may be cleaning up an aborted unpack, in which case the below type cannot be trusted */ _mapping_P[ci->map_type[i]]->free_info(ci->map_param[i]); for(i=0;i<ci->floors;i++) /* unpack does the range checking */ if(ci->floor_param[i]) /* this may be cleaning up an aborted unpack, in which case the below type cannot be trusted */ _floor_P[ci->floor_type[i]]->free_info(ci->floor_param[i]); for(i=0;i<ci->residues;i++) /* unpack does the range checking */ if(ci->residue_param[i]) /* this may be cleaning up an aborted unpack, in which case the below type cannot be trusted */ _residue_P[ci->residue_type[i]]->free_info(ci->residue_param[i]); for(i=0;i<ci->books;i++){ if(ci->book_param[i]){ /* knows if the book was not alloced */ vorbis_staticbook_destroy(ci->book_param[i]); } if(ci->fullbooks) vorbis_book_clear(ci->fullbooks+i); } if(ci->fullbooks) _ogg_free(ci->fullbooks); for(i=0;i<ci->psys;i++) _vi_psy_free(ci->psy_param[i]); _ogg_free(ci); } memset(vi,0,sizeof(*vi)); }
void BURGERCALL vorbis_info_clear(vorbis_info *vi){ codec_setup_info *ci=static_cast<codec_setup_info *>(vi->codec_setup); int i; if(ci){ for(i=0;i<ci->modes;i++) if(ci->mode_param[i])DeallocAPointer(ci->mode_param[i]); for(i=0;i<ci->maps;i++) /* unpack does the range checking */ _mapping_P[ci->map_type[i]]->free_info(ci->map_param[i]); for(i=0;i<ci->times;i++) /* unpack does the range checking */ _time_P[ci->time_type[i]]->free_info(ci->time_param[i]); for(i=0;i<ci->floors;i++) /* unpack does the range checking */ _floor_P[ci->floor_type[i]]->free_info(ci->floor_param[i]); for(i=0;i<ci->residues;i++) /* unpack does the range checking */ _residue_P[ci->residue_type[i]]->free_info(ci->residue_param[i]); for(i=0;i<ci->books;i++){ if(ci->book_param[i]){ /* knows if the book was not alloced */ vorbis_staticbook_destroy(ci->book_param[i]); } } for(i=0;i<ci->psys;i++) _vi_psy_free(ci->psy_param[i]); DeallocAPointer(ci); } FastMemSet(vi,0,sizeof(*vi)); }