Lines Matching refs:object
162 static void seektable_calculate_length_(FLAC__StreamMetadata *object) in seektable_calculate_length_() argument
164 FLAC__ASSERT(0 != object); in seektable_calculate_length_()
165 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); in seektable_calculate_length_()
167 object->length = object->data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH; in seektable_calculate_length_()
190 static void vorbiscomment_calculate_length_(FLAC__StreamMetadata *object) in vorbiscomment_calculate_length_() argument
194 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); in vorbiscomment_calculate_length_()
196 object->length = (FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN) / 8; in vorbiscomment_calculate_length_()
197 object->length += object->data.vorbis_comment.vendor_string.length; in vorbiscomment_calculate_length_()
198 object->length += (FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN) / 8; in vorbiscomment_calculate_length_()
199 for(i = 0; i < object->data.vorbis_comment.num_comments; i++) { in vorbiscomment_calculate_length_()
200 object->length += (FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN / 8); in vorbiscomment_calculate_length_()
201 object->length += object->data.vorbis_comment.comments[i].length; in vorbiscomment_calculate_length_()
249 static FLAC__bool vorbiscomment_set_entry_(FLAC__StreamMetadata *object, FLAC__StreamMetadata_Vorbi… in vorbiscomment_set_entry_() argument
253 FLAC__ASSERT(0 != object); in vorbiscomment_set_entry_()
256 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); in vorbiscomment_set_entry_()
291 vorbiscomment_calculate_length_(object); in vorbiscomment_set_entry_()
295 static int vorbiscomment_find_entry_from_(const FLAC__StreamMetadata *object, unsigned offset, cons… in vorbiscomment_find_entry_from_() argument
299 FLAC__ASSERT(0 != object); in vorbiscomment_find_entry_from_()
300 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); in vorbiscomment_find_entry_from_()
303 for(i = offset; i < object->data.vorbis_comment.num_comments; i++) { in vorbiscomment_find_entry_from_()
304 …if(FLAC__metadata_object_vorbiscomment_entry_matches(object->data.vorbis_comment.comments[i], fiel… in vorbiscomment_find_entry_from_()
311 static void cuesheet_calculate_length_(FLAC__StreamMetadata *object) in cuesheet_calculate_length_() argument
315 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); in cuesheet_calculate_length_()
317 object->length = ( in cuesheet_calculate_length_()
325 object->length += object->data.cue_sheet.num_tracks * ( in cuesheet_calculate_length_()
335 for(i = 0; i < object->data.cue_sheet.num_tracks; i++) { in cuesheet_calculate_length_()
336 object->length += object->data.cue_sheet.tracks[i].num_indices * ( in cuesheet_calculate_length_()
398 static FLAC__bool cuesheet_set_track_(FLAC__StreamMetadata *object, FLAC__StreamMetadata_CueSheet_T… in cuesheet_set_track_() argument
402 FLAC__ASSERT(0 != object); in cuesheet_set_track_()
405 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); in cuesheet_set_track_()
422 cuesheet_calculate_length_(object); in cuesheet_set_track_()
435 FLAC__StreamMetadata *object; in FLAC__metadata_object_new() local
440 object = (FLAC__StreamMetadata*)calloc(1, sizeof(FLAC__StreamMetadata)); in FLAC__metadata_object_new()
441 if(0 != object) { in FLAC__metadata_object_new()
442 object->is_last = false; in FLAC__metadata_object_new()
443 object->type = type; in FLAC__metadata_object_new()
446 object->length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH; in FLAC__metadata_object_new()
454 object->length = FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8; in FLAC__metadata_object_new()
467 object->data.vorbis_comment.vendor_string.length = (unsigned)strlen(FLAC__VENDOR_STRING); in FLAC__metadata_object_new()
468 …if(!copy_bytes_(&object->data.vorbis_comment.vendor_string.entry, (const FLAC__byte*)FLAC__VENDOR_… in FLAC__metadata_object_new()
469 free(object); in FLAC__metadata_object_new()
472 vorbiscomment_calculate_length_(object); in FLAC__metadata_object_new()
475 cuesheet_calculate_length_(object); in FLAC__metadata_object_new()
478 object->length = ( in FLAC__metadata_object_new()
489 object->data.picture.type = FLAC__STREAM_METADATA_PICTURE_TYPE_OTHER; in FLAC__metadata_object_new()
490 object->data.picture.mime_type = 0; in FLAC__metadata_object_new()
491 object->data.picture.description = 0; in FLAC__metadata_object_new()
501 if(!copy_cstring_(&object->data.picture.mime_type, "")) { in FLAC__metadata_object_new()
502 free(object); in FLAC__metadata_object_new()
505 if(!copy_cstring_((char**)(&object->data.picture.description), "")) { in FLAC__metadata_object_new()
506 if(object->data.picture.mime_type) in FLAC__metadata_object_new()
507 free(object->data.picture.mime_type); in FLAC__metadata_object_new()
508 free(object); in FLAC__metadata_object_new()
521 return object; in FLAC__metadata_object_new()
524 FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_clone(const FLAC__StreamMetadata *object) in FLAC__metadata_object_clone() argument
528 FLAC__ASSERT(0 != object); in FLAC__metadata_object_clone()
530 if(0 != (to = FLAC__metadata_object_new(object->type))) { in FLAC__metadata_object_clone()
531 to->is_last = object->is_last; in FLAC__metadata_object_clone()
532 to->type = object->type; in FLAC__metadata_object_clone()
533 to->length = object->length; in FLAC__metadata_object_clone()
536 … memcpy(&to->data.stream_info, &object->data.stream_info, sizeof(FLAC__StreamMetadata_StreamInfo)); in FLAC__metadata_object_clone()
545 …memcpy(&to->data.application.id, &object->data.application.id, FLAC__STREAM_METADATA_APPLICATION_I… in FLAC__metadata_object_clone()
546 …if(!copy_bytes_(&to->data.application.data, object->data.application.data, object->length - FLAC__… in FLAC__metadata_object_clone()
552 to->data.seek_table.num_points = object->data.seek_table.num_points; in FLAC__metadata_object_clone()
557 …((FLAC__byte**)&to->data.seek_table.points, (FLAC__byte*)object->data.seek_table.points, object->d… in FLAC__metadata_object_clone()
567 …if(!copy_vcentry_(&to->data.vorbis_comment.vendor_string, &object->data.vorbis_comment.vendor_stri… in FLAC__metadata_object_clone()
571 if(object->data.vorbis_comment.num_comments == 0) { in FLAC__metadata_object_clone()
572 FLAC__ASSERT(0 == object->data.vorbis_comment.comments); in FLAC__metadata_object_clone()
576 FLAC__ASSERT(0 != object->data.vorbis_comment.comments); in FLAC__metadata_object_clone()
577 …is_comment.comments = vorbiscomment_entry_array_copy_(object->data.vorbis_comment.comments, object… in FLAC__metadata_object_clone()
583 to->data.vorbis_comment.num_comments = object->data.vorbis_comment.num_comments; in FLAC__metadata_object_clone()
586 memcpy(&to->data.cue_sheet, &object->data.cue_sheet, sizeof(FLAC__StreamMetadata_CueSheet)); in FLAC__metadata_object_clone()
587 if(object->data.cue_sheet.num_tracks == 0) { in FLAC__metadata_object_clone()
588 FLAC__ASSERT(0 == object->data.cue_sheet.tracks); in FLAC__metadata_object_clone()
591 FLAC__ASSERT(0 != object->data.cue_sheet.tracks); in FLAC__metadata_object_clone()
592 …to->data.cue_sheet.tracks = cuesheet_track_array_copy_(object->data.cue_sheet.tracks, object->data… in FLAC__metadata_object_clone()
600 to->data.picture.type = object->data.picture.type; in FLAC__metadata_object_clone()
601 if(!copy_cstring_(&to->data.picture.mime_type, object->data.picture.mime_type)) { in FLAC__metadata_object_clone()
605 …if(!copy_cstring_((char**)(&to->data.picture.description), (const char*)object->data.picture.descr… in FLAC__metadata_object_clone()
609 to->data.picture.width = object->data.picture.width; in FLAC__metadata_object_clone()
610 to->data.picture.height = object->data.picture.height; in FLAC__metadata_object_clone()
611 to->data.picture.depth = object->data.picture.depth; in FLAC__metadata_object_clone()
612 to->data.picture.colors = object->data.picture.colors; in FLAC__metadata_object_clone()
613 to->data.picture.data_length = object->data.picture.data_length; in FLAC__metadata_object_clone()
614 …if(!copy_bytes_((&to->data.picture.data), object->data.picture.data, object->data.picture.data_len… in FLAC__metadata_object_clone()
620 if(!copy_bytes_(&to->data.unknown.data, object->data.unknown.data, object->length)) { in FLAC__metadata_object_clone()
631 void FLAC__metadata_object_delete_data(FLAC__StreamMetadata *object) in FLAC__metadata_object_delete_data() argument
633 FLAC__ASSERT(0 != object); in FLAC__metadata_object_delete_data()
635 switch(object->type) { in FLAC__metadata_object_delete_data()
640 if(0 != object->data.application.data) { in FLAC__metadata_object_delete_data()
641 free(object->data.application.data); in FLAC__metadata_object_delete_data()
642 object->data.application.data = 0; in FLAC__metadata_object_delete_data()
646 if(0 != object->data.seek_table.points) { in FLAC__metadata_object_delete_data()
647 free(object->data.seek_table.points); in FLAC__metadata_object_delete_data()
648 object->data.seek_table.points = 0; in FLAC__metadata_object_delete_data()
652 if(0 != object->data.vorbis_comment.vendor_string.entry) { in FLAC__metadata_object_delete_data()
653 free(object->data.vorbis_comment.vendor_string.entry); in FLAC__metadata_object_delete_data()
654 object->data.vorbis_comment.vendor_string.entry = 0; in FLAC__metadata_object_delete_data()
656 if(0 != object->data.vorbis_comment.comments) { in FLAC__metadata_object_delete_data()
657 FLAC__ASSERT(object->data.vorbis_comment.num_comments > 0); in FLAC__metadata_object_delete_data()
658 …vorbiscomment_entry_array_delete_(object->data.vorbis_comment.comments, object->data.vorbis_commen… in FLAC__metadata_object_delete_data()
662 if(0 != object->data.cue_sheet.tracks) { in FLAC__metadata_object_delete_data()
663 FLAC__ASSERT(object->data.cue_sheet.num_tracks > 0); in FLAC__metadata_object_delete_data()
664 cuesheet_track_array_delete_(object->data.cue_sheet.tracks, object->data.cue_sheet.num_tracks); in FLAC__metadata_object_delete_data()
668 if(0 != object->data.picture.mime_type) { in FLAC__metadata_object_delete_data()
669 free(object->data.picture.mime_type); in FLAC__metadata_object_delete_data()
670 object->data.picture.mime_type = 0; in FLAC__metadata_object_delete_data()
672 if(0 != object->data.picture.description) { in FLAC__metadata_object_delete_data()
673 free(object->data.picture.description); in FLAC__metadata_object_delete_data()
674 object->data.picture.description = 0; in FLAC__metadata_object_delete_data()
676 if(0 != object->data.picture.data) { in FLAC__metadata_object_delete_data()
677 free(object->data.picture.data); in FLAC__metadata_object_delete_data()
678 object->data.picture.data = 0; in FLAC__metadata_object_delete_data()
682 if(0 != object->data.unknown.data) { in FLAC__metadata_object_delete_data()
683 free(object->data.unknown.data); in FLAC__metadata_object_delete_data()
684 object->data.unknown.data = 0; in FLAC__metadata_object_delete_data()
690 FLAC_API void FLAC__metadata_object_delete(FLAC__StreamMetadata *object) in FLAC__metadata_object_delete() argument
692 FLAC__metadata_object_delete_data(object); in FLAC__metadata_object_delete()
693 free(object); in FLAC__metadata_object_delete()
903 FLAC_API FLAC__bool FLAC__metadata_object_application_set_data(FLAC__StreamMetadata *object, FLAC__… in FLAC__metadata_object_application_set_data() argument
907 FLAC__ASSERT(0 != object); in FLAC__metadata_object_application_set_data()
908 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_APPLICATION); in FLAC__metadata_object_application_set_data()
911 save = object->data.application.data; in FLAC__metadata_object_application_set_data()
915 if(!copy_bytes_(&object->data.application.data, data, length)) in FLAC__metadata_object_application_set_data()
919 object->data.application.data = data; in FLAC__metadata_object_application_set_data()
925 object->length = FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8 + length; in FLAC__metadata_object_application_set_data()
929 FLAC_API FLAC__bool FLAC__metadata_object_seektable_resize_points(FLAC__StreamMetadata *object, uns… in FLAC__metadata_object_seektable_resize_points() argument
931 FLAC__ASSERT(0 != object); in FLAC__metadata_object_seektable_resize_points()
932 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); in FLAC__metadata_object_seektable_resize_points()
934 if(0 == object->data.seek_table.points) { in FLAC__metadata_object_seektable_resize_points()
935 FLAC__ASSERT(object->data.seek_table.num_points == 0); in FLAC__metadata_object_seektable_resize_points()
938 else if(0 == (object->data.seek_table.points = seekpoint_array_new_(new_num_points))) in FLAC__metadata_object_seektable_resize_points()
942 …const size_t old_size = object->data.seek_table.num_points * sizeof(FLAC__StreamMetadata_SeekPoint… in FLAC__metadata_object_seektable_resize_points()
949 FLAC__ASSERT(object->data.seek_table.num_points > 0); in FLAC__metadata_object_seektable_resize_points()
952 free(object->data.seek_table.points); in FLAC__metadata_object_seektable_resize_points()
953 object->data.seek_table.points = 0; in FLAC__metadata_object_seektable_resize_points()
955 …else if(0 == (object->data.seek_table.points = (FLAC__StreamMetadata_SeekPoint*)realloc(object->da… in FLAC__metadata_object_seektable_resize_points()
961 for(i = object->data.seek_table.num_points; i < new_num_points; i++) { in FLAC__metadata_object_seektable_resize_points()
962 object->data.seek_table.points[i].sample_number = FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER; in FLAC__metadata_object_seektable_resize_points()
963 object->data.seek_table.points[i].stream_offset = 0; in FLAC__metadata_object_seektable_resize_points()
964 object->data.seek_table.points[i].frame_samples = 0; in FLAC__metadata_object_seektable_resize_points()
969 object->data.seek_table.num_points = new_num_points; in FLAC__metadata_object_seektable_resize_points()
971 seektable_calculate_length_(object); in FLAC__metadata_object_seektable_resize_points()
975 FLAC_API void FLAC__metadata_object_seektable_set_point(FLAC__StreamMetadata *object, unsigned poin… in FLAC__metadata_object_seektable_set_point() argument
977 FLAC__ASSERT(0 != object); in FLAC__metadata_object_seektable_set_point()
978 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); in FLAC__metadata_object_seektable_set_point()
979 FLAC__ASSERT(point_num < object->data.seek_table.num_points); in FLAC__metadata_object_seektable_set_point()
981 object->data.seek_table.points[point_num] = point; in FLAC__metadata_object_seektable_set_point()
984 FLAC_API FLAC__bool FLAC__metadata_object_seektable_insert_point(FLAC__StreamMetadata *object, unsi… in FLAC__metadata_object_seektable_insert_point() argument
988 FLAC__ASSERT(0 != object); in FLAC__metadata_object_seektable_insert_point()
989 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); in FLAC__metadata_object_seektable_insert_point()
990 FLAC__ASSERT(point_num <= object->data.seek_table.num_points); in FLAC__metadata_object_seektable_insert_point()
992 if(!FLAC__metadata_object_seektable_resize_points(object, object->data.seek_table.num_points+1)) in FLAC__metadata_object_seektable_insert_point()
996 for(i = (int)object->data.seek_table.num_points-1; i > (int)point_num; i--) in FLAC__metadata_object_seektable_insert_point()
997 object->data.seek_table.points[i] = object->data.seek_table.points[i-1]; in FLAC__metadata_object_seektable_insert_point()
999 FLAC__metadata_object_seektable_set_point(object, point_num, point); in FLAC__metadata_object_seektable_insert_point()
1000 seektable_calculate_length_(object); in FLAC__metadata_object_seektable_insert_point()
1004 FLAC_API FLAC__bool FLAC__metadata_object_seektable_delete_point(FLAC__StreamMetadata *object, unsi… in FLAC__metadata_object_seektable_delete_point() argument
1008 FLAC__ASSERT(0 != object); in FLAC__metadata_object_seektable_delete_point()
1009 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); in FLAC__metadata_object_seektable_delete_point()
1010 FLAC__ASSERT(point_num < object->data.seek_table.num_points); in FLAC__metadata_object_seektable_delete_point()
1013 for(i = point_num; i < object->data.seek_table.num_points-1; i++) in FLAC__metadata_object_seektable_delete_point()
1014 object->data.seek_table.points[i] = object->data.seek_table.points[i+1]; in FLAC__metadata_object_seektable_delete_point()
1016 return FLAC__metadata_object_seektable_resize_points(object, object->data.seek_table.num_points-1); in FLAC__metadata_object_seektable_delete_point()
1019 FLAC_API FLAC__bool FLAC__metadata_object_seektable_is_legal(const FLAC__StreamMetadata *object) in FLAC__metadata_object_seektable_is_legal() argument
1021 FLAC__ASSERT(0 != object); in FLAC__metadata_object_seektable_is_legal()
1022 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); in FLAC__metadata_object_seektable_is_legal()
1024 return FLAC__format_seektable_is_legal(&object->data.seek_table); in FLAC__metadata_object_seektable_is_legal()
1027 …_metadata_object_seektable_template_append_placeholders(FLAC__StreamMetadata *object, unsigned num) in FLAC__metadata_object_seektable_template_append_placeholders() argument
1029 FLAC__ASSERT(0 != object); in FLAC__metadata_object_seektable_template_append_placeholders()
1030 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); in FLAC__metadata_object_seektable_template_append_placeholders()
1034 …return FLAC__metadata_object_seektable_resize_points(object, object->data.seek_table.num_points + … in FLAC__metadata_object_seektable_template_append_placeholders()
1039 …C__metadata_object_seektable_template_append_point(FLAC__StreamMetadata *object, FLAC__uint64 samp… in FLAC__metadata_object_seektable_template_append_point() argument
1043 FLAC__ASSERT(0 != object); in FLAC__metadata_object_seektable_template_append_point()
1044 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); in FLAC__metadata_object_seektable_template_append_point()
1046 seek_table = &object->data.seek_table; in FLAC__metadata_object_seektable_template_append_point()
1048 if(!FLAC__metadata_object_seektable_resize_points(object, seek_table->num_points + 1)) in FLAC__metadata_object_seektable_template_append_point()
1058 …__metadata_object_seektable_template_append_points(FLAC__StreamMetadata *object, FLAC__uint64 samp… in FLAC__metadata_object_seektable_template_append_points() argument
1060 FLAC__ASSERT(0 != object); in FLAC__metadata_object_seektable_template_append_points()
1061 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); in FLAC__metadata_object_seektable_template_append_points()
1065 FLAC__StreamMetadata_SeekTable *seek_table = &object->data.seek_table; in FLAC__metadata_object_seektable_template_append_points()
1070 if(!FLAC__metadata_object_seektable_resize_points(object, seek_table->num_points + num)) in FLAC__metadata_object_seektable_template_append_points()
1083 …ata_object_seektable_template_append_spaced_points(FLAC__StreamMetadata *object, unsigned num, FLA… in FLAC__metadata_object_seektable_template_append_spaced_points() argument
1085 FLAC__ASSERT(0 != object); in FLAC__metadata_object_seektable_template_append_spaced_points()
1086 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); in FLAC__metadata_object_seektable_template_append_spaced_points()
1090 FLAC__StreamMetadata_SeekTable *seek_table = &object->data.seek_table; in FLAC__metadata_object_seektable_template_append_spaced_points()
1095 if(!FLAC__metadata_object_seektable_resize_points(object, seek_table->num_points + num)) in FLAC__metadata_object_seektable_template_append_spaced_points()
1108 …seektable_template_append_spaced_points_by_samples(FLAC__StreamMetadata *object, unsigned samples,… in FLAC__metadata_object_seektable_template_append_spaced_points_by_samples() argument
1110 FLAC__ASSERT(0 != object); in FLAC__metadata_object_seektable_template_append_spaced_points_by_samples()
1111 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); in FLAC__metadata_object_seektable_template_append_spaced_points_by_samples()
1116 FLAC__StreamMetadata_SeekTable *seek_table = &object->data.seek_table; in FLAC__metadata_object_seektable_template_append_spaced_points_by_samples()
1127 if(!FLAC__metadata_object_seektable_resize_points(object, seek_table->num_points + (unsigned)num)) in FLAC__metadata_object_seektable_template_append_spaced_points_by_samples()
1141 FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_sort(FLAC__StreamMetadata *object, FLA… in FLAC__metadata_object_seektable_template_sort() argument
1145 FLAC__ASSERT(0 != object); in FLAC__metadata_object_seektable_template_sort()
1146 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); in FLAC__metadata_object_seektable_template_sort()
1148 unique = FLAC__format_seektable_sort(&object->data.seek_table); in FLAC__metadata_object_seektable_template_sort()
1150 return !compact || FLAC__metadata_object_seektable_resize_points(object, unique); in FLAC__metadata_object_seektable_template_sort()
1153 …C__metadata_object_vorbiscomment_set_vendor_string(FLAC__StreamMetadata *object, FLAC__StreamMetad… in FLAC__metadata_object_vorbiscomment_set_vendor_string() argument
1157 return vorbiscomment_set_entry_(object, &object->data.vorbis_comment.vendor_string, &entry, copy); in FLAC__metadata_object_vorbiscomment_set_vendor_string()
1160 …LAC__metadata_object_vorbiscomment_resize_comments(FLAC__StreamMetadata *object, unsigned new_num_… in FLAC__metadata_object_vorbiscomment_resize_comments() argument
1162 FLAC__ASSERT(0 != object); in FLAC__metadata_object_vorbiscomment_resize_comments()
1163 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); in FLAC__metadata_object_vorbiscomment_resize_comments()
1165 if(0 == object->data.vorbis_comment.comments) { in FLAC__metadata_object_vorbiscomment_resize_comments()
1166 FLAC__ASSERT(object->data.vorbis_comment.num_comments == 0); in FLAC__metadata_object_vorbiscomment_resize_comments()
1169 …else if(0 == (object->data.vorbis_comment.comments = vorbiscomment_entry_array_new_(new_num_commen… in FLAC__metadata_object_vorbiscomment_resize_comments()
1173 …const size_t old_size = object->data.vorbis_comment.num_comments * sizeof(FLAC__StreamMetadata_Vor… in FLAC__metadata_object_vorbiscomment_resize_comments()
1180 FLAC__ASSERT(object->data.vorbis_comment.num_comments > 0); in FLAC__metadata_object_vorbiscomment_resize_comments()
1183 if(new_num_comments < object->data.vorbis_comment.num_comments) { in FLAC__metadata_object_vorbiscomment_resize_comments()
1185 for(i = new_num_comments; i < object->data.vorbis_comment.num_comments; i++) in FLAC__metadata_object_vorbiscomment_resize_comments()
1186 if(0 != object->data.vorbis_comment.comments[i].entry) in FLAC__metadata_object_vorbiscomment_resize_comments()
1187 free(object->data.vorbis_comment.comments[i].entry); in FLAC__metadata_object_vorbiscomment_resize_comments()
1191 free(object->data.vorbis_comment.comments); in FLAC__metadata_object_vorbiscomment_resize_comments()
1192 object->data.vorbis_comment.comments = 0; in FLAC__metadata_object_vorbiscomment_resize_comments()
1194 …else if(0 == (object->data.vorbis_comment.comments = (FLAC__StreamMetadata_VorbisComment_Entry*)re… in FLAC__metadata_object_vorbiscomment_resize_comments()
1199 …memset(object->data.vorbis_comment.comments + object->data.vorbis_comment.num_comments, 0, new_siz… in FLAC__metadata_object_vorbiscomment_resize_comments()
1202 object->data.vorbis_comment.num_comments = new_num_comments; in FLAC__metadata_object_vorbiscomment_resize_comments()
1204 vorbiscomment_calculate_length_(object); in FLAC__metadata_object_vorbiscomment_resize_comments()
1208 FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_set_comment(FLAC__StreamMetadata *object, u… in FLAC__metadata_object_vorbiscomment_set_comment() argument
1210 FLAC__ASSERT(0 != object); in FLAC__metadata_object_vorbiscomment_set_comment()
1211 FLAC__ASSERT(comment_num < object->data.vorbis_comment.num_comments); in FLAC__metadata_object_vorbiscomment_set_comment()
1215 …return vorbiscomment_set_entry_(object, &object->data.vorbis_comment.comments[comment_num], &entry… in FLAC__metadata_object_vorbiscomment_set_comment()
1218 FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_insert_comment(FLAC__StreamMetadata *object… in FLAC__metadata_object_vorbiscomment_insert_comment() argument
1222 FLAC__ASSERT(0 != object); in FLAC__metadata_object_vorbiscomment_insert_comment()
1223 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); in FLAC__metadata_object_vorbiscomment_insert_comment()
1224 FLAC__ASSERT(comment_num <= object->data.vorbis_comment.num_comments); in FLAC__metadata_object_vorbiscomment_insert_comment()
1229 vc = &object->data.vorbis_comment; in FLAC__metadata_object_vorbiscomment_insert_comment()
1231 if(!FLAC__metadata_object_vorbiscomment_resize_comments(object, vc->num_comments+1)) in FLAC__metadata_object_vorbiscomment_insert_comment()
1239 return FLAC__metadata_object_vorbiscomment_set_comment(object, comment_num, entry, copy); in FLAC__metadata_object_vorbiscomment_insert_comment()
1242 FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_append_comment(FLAC__StreamMetadata *object… in FLAC__metadata_object_vorbiscomment_append_comment() argument
1244 FLAC__ASSERT(0 != object); in FLAC__metadata_object_vorbiscomment_append_comment()
1245 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); in FLAC__metadata_object_vorbiscomment_append_comment()
1246 …return FLAC__metadata_object_vorbiscomment_insert_comment(object, object->data.vorbis_comment.num_… in FLAC__metadata_object_vorbiscomment_append_comment()
1249 …LAC__metadata_object_vorbiscomment_replace_comment(FLAC__StreamMetadata *object, FLAC__StreamMetad… in FLAC__metadata_object_vorbiscomment_replace_comment() argument
1268 …if((i = vorbiscomment_find_entry_from_(object, 0, (const char *)entry.entry, field_name_length)) >… in FLAC__metadata_object_vorbiscomment_replace_comment()
1270 if(!FLAC__metadata_object_vorbiscomment_set_comment(object, index, entry, copy)) in FLAC__metadata_object_vorbiscomment_replace_comment()
1272 if(all && (index+1 < object->data.vorbis_comment.num_comments)) { in FLAC__metadata_object_vorbiscomment_replace_comment()
1273 …for(i = vorbiscomment_find_entry_from_(object, index+1, (const char *)entry.entry, field_name_leng… in FLAC__metadata_object_vorbiscomment_replace_comment()
1274 if(!FLAC__metadata_object_vorbiscomment_delete_comment(object, (unsigned)i)) in FLAC__metadata_object_vorbiscomment_replace_comment()
1276 if((unsigned)i < object->data.vorbis_comment.num_comments) in FLAC__metadata_object_vorbiscomment_replace_comment()
1277 …i = vorbiscomment_find_entry_from_(object, (unsigned)i, (const char *)entry.entry, field_name_leng… in FLAC__metadata_object_vorbiscomment_replace_comment()
1285 return FLAC__metadata_object_vorbiscomment_append_comment(object, entry, copy); in FLAC__metadata_object_vorbiscomment_replace_comment()
1289 FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_delete_comment(FLAC__StreamMetadata *object… in FLAC__metadata_object_vorbiscomment_delete_comment() argument
1293 FLAC__ASSERT(0 != object); in FLAC__metadata_object_vorbiscomment_delete_comment()
1294 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); in FLAC__metadata_object_vorbiscomment_delete_comment()
1295 FLAC__ASSERT(comment_num < object->data.vorbis_comment.num_comments); in FLAC__metadata_object_vorbiscomment_delete_comment()
1297 vc = &object->data.vorbis_comment; in FLAC__metadata_object_vorbiscomment_delete_comment()
1308 return FLAC__metadata_object_vorbiscomment_resize_comments(object, vc->num_comments-1); in FLAC__metadata_object_vorbiscomment_delete_comment()
1383 FLAC_API int FLAC__metadata_object_vorbiscomment_find_entry_from(const FLAC__StreamMetadata *object… in FLAC__metadata_object_vorbiscomment_find_entry_from() argument
1387 return vorbiscomment_find_entry_from_(object, offset, field_name, strlen(field_name)); in FLAC__metadata_object_vorbiscomment_find_entry_from()
1390 FLAC_API int FLAC__metadata_object_vorbiscomment_remove_entry_matching(FLAC__StreamMetadata *object… in FLAC__metadata_object_vorbiscomment_remove_entry_matching() argument
1395 FLAC__ASSERT(0 != object); in FLAC__metadata_object_vorbiscomment_remove_entry_matching()
1396 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); in FLAC__metadata_object_vorbiscomment_remove_entry_matching()
1398 for(i = 0; i < object->data.vorbis_comment.num_comments; i++) { in FLAC__metadata_object_vorbiscomment_remove_entry_matching()
1399 …if(FLAC__metadata_object_vorbiscomment_entry_matches(object->data.vorbis_comment.comments[i], fiel… in FLAC__metadata_object_vorbiscomment_remove_entry_matching()
1400 if(!FLAC__metadata_object_vorbiscomment_delete_comment(object, i)) in FLAC__metadata_object_vorbiscomment_remove_entry_matching()
1410 …adata_object_vorbiscomment_remove_entries_matching(FLAC__StreamMetadata *object, const char *field… in FLAC__metadata_object_vorbiscomment_remove_entries_matching() argument
1417 FLAC__ASSERT(0 != object); in FLAC__metadata_object_vorbiscomment_remove_entries_matching()
1418 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); in FLAC__metadata_object_vorbiscomment_remove_entries_matching()
1421 for(i = (int)object->data.vorbis_comment.num_comments - 1; ok && i >= 0; i--) { in FLAC__metadata_object_vorbiscomment_remove_entries_matching()
1422 …if(FLAC__metadata_object_vorbiscomment_entry_matches(object->data.vorbis_comment.comments[i], fiel… in FLAC__metadata_object_vorbiscomment_remove_entries_matching()
1424 ok &= FLAC__metadata_object_vorbiscomment_delete_comment(object, (unsigned)i); in FLAC__metadata_object_vorbiscomment_remove_entries_matching()
1436 …rack *FLAC__metadata_object_cuesheet_track_clone(const FLAC__StreamMetadata_CueSheet_Track *object) in FLAC__metadata_object_cuesheet_track_clone() argument
1440 FLAC__ASSERT(0 != object); in FLAC__metadata_object_cuesheet_track_clone()
1443 if(!copy_track_(to, object)) { in FLAC__metadata_object_cuesheet_track_clone()
1452 void FLAC__metadata_object_cuesheet_track_delete_data(FLAC__StreamMetadata_CueSheet_Track *object) in FLAC__metadata_object_cuesheet_track_delete_data() argument
1454 FLAC__ASSERT(0 != object); in FLAC__metadata_object_cuesheet_track_delete_data()
1456 if(0 != object->indices) { in FLAC__metadata_object_cuesheet_track_delete_data()
1457 FLAC__ASSERT(object->num_indices > 0); in FLAC__metadata_object_cuesheet_track_delete_data()
1458 free(object->indices); in FLAC__metadata_object_cuesheet_track_delete_data()
1462 …C_API void FLAC__metadata_object_cuesheet_track_delete(FLAC__StreamMetadata_CueSheet_Track *object) in FLAC__metadata_object_cuesheet_track_delete() argument
1464 FLAC__metadata_object_cuesheet_track_delete_data(object); in FLAC__metadata_object_cuesheet_track_delete()
1465 free(object); in FLAC__metadata_object_cuesheet_track_delete()
1468 …LAC__metadata_object_cuesheet_track_resize_indices(FLAC__StreamMetadata *object, unsigned track_nu… in FLAC__metadata_object_cuesheet_track_resize_indices() argument
1471 FLAC__ASSERT(0 != object); in FLAC__metadata_object_cuesheet_track_resize_indices()
1472 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); in FLAC__metadata_object_cuesheet_track_resize_indices()
1473 FLAC__ASSERT(track_num < object->data.cue_sheet.num_tracks); in FLAC__metadata_object_cuesheet_track_resize_indices()
1475 track = &object->data.cue_sheet.tracks[track_num]; in FLAC__metadata_object_cuesheet_track_resize_indices()
1508 cuesheet_calculate_length_(object); in FLAC__metadata_object_cuesheet_track_resize_indices()
1512 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_insert_index(FLAC__StreamMetadata *object,… in FLAC__metadata_object_cuesheet_track_insert_index() argument
1516 FLAC__ASSERT(0 != object); in FLAC__metadata_object_cuesheet_track_insert_index()
1517 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); in FLAC__metadata_object_cuesheet_track_insert_index()
1518 FLAC__ASSERT(track_num < object->data.cue_sheet.num_tracks); in FLAC__metadata_object_cuesheet_track_insert_index()
1519 FLAC__ASSERT(index_num <= object->data.cue_sheet.tracks[track_num].num_indices); in FLAC__metadata_object_cuesheet_track_insert_index()
1521 track = &object->data.cue_sheet.tracks[track_num]; in FLAC__metadata_object_cuesheet_track_insert_index()
1523 if(!FLAC__metadata_object_cuesheet_track_resize_indices(object, track_num, track->num_indices+1)) in FLAC__metadata_object_cuesheet_track_insert_index()
1530 cuesheet_calculate_length_(object); in FLAC__metadata_object_cuesheet_track_insert_index()
1534 …_metadata_object_cuesheet_track_insert_blank_index(FLAC__StreamMetadata *object, unsigned track_nu… in FLAC__metadata_object_cuesheet_track_insert_blank_index() argument
1538 return FLAC__metadata_object_cuesheet_track_insert_index(object, track_num, index_num, index); in FLAC__metadata_object_cuesheet_track_insert_blank_index()
1541 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_delete_index(FLAC__StreamMetadata *object,… in FLAC__metadata_object_cuesheet_track_delete_index() argument
1545 FLAC__ASSERT(0 != object); in FLAC__metadata_object_cuesheet_track_delete_index()
1546 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); in FLAC__metadata_object_cuesheet_track_delete_index()
1547 FLAC__ASSERT(track_num < object->data.cue_sheet.num_tracks); in FLAC__metadata_object_cuesheet_track_delete_index()
1548 FLAC__ASSERT(index_num < object->data.cue_sheet.tracks[track_num].num_indices); in FLAC__metadata_object_cuesheet_track_delete_index()
1550 track = &object->data.cue_sheet.tracks[track_num]; in FLAC__metadata_object_cuesheet_track_delete_index()
1555 FLAC__metadata_object_cuesheet_track_resize_indices(object, track_num, track->num_indices-1); in FLAC__metadata_object_cuesheet_track_delete_index()
1556 cuesheet_calculate_length_(object); in FLAC__metadata_object_cuesheet_track_delete_index()
1560 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_resize_tracks(FLAC__StreamMetadata *object, unsi… in FLAC__metadata_object_cuesheet_resize_tracks() argument
1562 FLAC__ASSERT(0 != object); in FLAC__metadata_object_cuesheet_resize_tracks()
1563 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); in FLAC__metadata_object_cuesheet_resize_tracks()
1565 if(0 == object->data.cue_sheet.tracks) { in FLAC__metadata_object_cuesheet_resize_tracks()
1566 FLAC__ASSERT(object->data.cue_sheet.num_tracks == 0); in FLAC__metadata_object_cuesheet_resize_tracks()
1569 else if(0 == (object->data.cue_sheet.tracks = cuesheet_track_array_new_(new_num_tracks))) in FLAC__metadata_object_cuesheet_resize_tracks()
1573 …const size_t old_size = object->data.cue_sheet.num_tracks * sizeof(FLAC__StreamMetadata_CueSheet_T… in FLAC__metadata_object_cuesheet_resize_tracks()
1580 FLAC__ASSERT(object->data.cue_sheet.num_tracks > 0); in FLAC__metadata_object_cuesheet_resize_tracks()
1583 if(new_num_tracks < object->data.cue_sheet.num_tracks) { in FLAC__metadata_object_cuesheet_resize_tracks()
1585 for(i = new_num_tracks; i < object->data.cue_sheet.num_tracks; i++) in FLAC__metadata_object_cuesheet_resize_tracks()
1586 if(0 != object->data.cue_sheet.tracks[i].indices) in FLAC__metadata_object_cuesheet_resize_tracks()
1587 free(object->data.cue_sheet.tracks[i].indices); in FLAC__metadata_object_cuesheet_resize_tracks()
1591 free(object->data.cue_sheet.tracks); in FLAC__metadata_object_cuesheet_resize_tracks()
1592 object->data.cue_sheet.tracks = 0; in FLAC__metadata_object_cuesheet_resize_tracks()
1594 …else if(0 == (object->data.cue_sheet.tracks = (FLAC__StreamMetadata_CueSheet_Track*)realloc(object… in FLAC__metadata_object_cuesheet_resize_tracks()
1599 … memset(object->data.cue_sheet.tracks + object->data.cue_sheet.num_tracks, 0, new_size - old_size); in FLAC__metadata_object_cuesheet_resize_tracks()
1602 object->data.cue_sheet.num_tracks = new_num_tracks; in FLAC__metadata_object_cuesheet_resize_tracks()
1604 cuesheet_calculate_length_(object); in FLAC__metadata_object_cuesheet_resize_tracks()
1608 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_set_track(FLAC__StreamMetadata *object, unsigned… in FLAC__metadata_object_cuesheet_set_track() argument
1610 FLAC__ASSERT(0 != object); in FLAC__metadata_object_cuesheet_set_track()
1611 FLAC__ASSERT(track_num < object->data.cue_sheet.num_tracks); in FLAC__metadata_object_cuesheet_set_track()
1613 return cuesheet_set_track_(object, object->data.cue_sheet.tracks + track_num, track, copy); in FLAC__metadata_object_cuesheet_set_track()
1616 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_insert_track(FLAC__StreamMetadata *object, unsig… in FLAC__metadata_object_cuesheet_insert_track() argument
1620 FLAC__ASSERT(0 != object); in FLAC__metadata_object_cuesheet_insert_track()
1621 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); in FLAC__metadata_object_cuesheet_insert_track()
1622 FLAC__ASSERT(track_num <= object->data.cue_sheet.num_tracks); in FLAC__metadata_object_cuesheet_insert_track()
1624 cs = &object->data.cue_sheet; in FLAC__metadata_object_cuesheet_insert_track()
1626 if(!FLAC__metadata_object_cuesheet_resize_tracks(object, cs->num_tracks+1)) in FLAC__metadata_object_cuesheet_insert_track()
1634 return FLAC__metadata_object_cuesheet_set_track(object, track_num, track, copy); in FLAC__metadata_object_cuesheet_insert_track()
1637 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_insert_blank_track(FLAC__StreamMetadata *object,… in FLAC__metadata_object_cuesheet_insert_blank_track() argument
1641 return FLAC__metadata_object_cuesheet_insert_track(object, track_num, &track, /*copy=*/false); in FLAC__metadata_object_cuesheet_insert_blank_track()
1644 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_delete_track(FLAC__StreamMetadata *object, unsig… in FLAC__metadata_object_cuesheet_delete_track() argument
1648 FLAC__ASSERT(0 != object); in FLAC__metadata_object_cuesheet_delete_track()
1649 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); in FLAC__metadata_object_cuesheet_delete_track()
1650 FLAC__ASSERT(track_num < object->data.cue_sheet.num_tracks); in FLAC__metadata_object_cuesheet_delete_track()
1652 cs = &object->data.cue_sheet; in FLAC__metadata_object_cuesheet_delete_track()
1663 return FLAC__metadata_object_cuesheet_resize_tracks(object, cs->num_tracks-1); in FLAC__metadata_object_cuesheet_delete_track()
1666 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_is_legal(const FLAC__StreamMetadata *object, FLA… in FLAC__metadata_object_cuesheet_is_legal() argument
1668 FLAC__ASSERT(0 != object); in FLAC__metadata_object_cuesheet_is_legal()
1669 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); in FLAC__metadata_object_cuesheet_is_legal()
1671 return FLAC__format_cuesheet_is_legal(&object->data.cue_sheet, check_cd_da_subset, violation); in FLAC__metadata_object_cuesheet_is_legal()
1699 …I FLAC__uint32 FLAC__metadata_object_cuesheet_calculate_cddb_id(const FLAC__StreamMetadata *object) in FLAC__metadata_object_cuesheet_calculate_cddb_id() argument
1703 FLAC__ASSERT(0 != object); in FLAC__metadata_object_cuesheet_calculate_cddb_id()
1704 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); in FLAC__metadata_object_cuesheet_calculate_cddb_id()
1706 cs = &object->data.cue_sheet; in FLAC__metadata_object_cuesheet_calculate_cddb_id()
1721 FLAC_API FLAC__bool FLAC__metadata_object_picture_set_mime_type(FLAC__StreamMetadata *object, char … in FLAC__metadata_object_picture_set_mime_type() argument
1726 FLAC__ASSERT(0 != object); in FLAC__metadata_object_picture_set_mime_type()
1727 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_PICTURE); in FLAC__metadata_object_picture_set_mime_type()
1730 old = object->data.picture.mime_type; in FLAC__metadata_object_picture_set_mime_type()
1738 …if(!copy_bytes_((FLAC__byte**)(&object->data.picture.mime_type), (FLAC__byte*)mime_type, new_lengt… in FLAC__metadata_object_picture_set_mime_type()
1742 object->data.picture.mime_type = mime_type; in FLAC__metadata_object_picture_set_mime_type()
1748 object->length -= old_length; in FLAC__metadata_object_picture_set_mime_type()
1749 object->length += new_length; in FLAC__metadata_object_picture_set_mime_type()
1753 FLAC_API FLAC__bool FLAC__metadata_object_picture_set_description(FLAC__StreamMetadata *object, FLA… in FLAC__metadata_object_picture_set_description() argument
1758 FLAC__ASSERT(0 != object); in FLAC__metadata_object_picture_set_description()
1759 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_PICTURE); in FLAC__metadata_object_picture_set_description()
1762 old = object->data.picture.description; in FLAC__metadata_object_picture_set_description()
1770 if(!copy_bytes_(&object->data.picture.description, description, new_length+1)) in FLAC__metadata_object_picture_set_description()
1774 object->data.picture.description = description; in FLAC__metadata_object_picture_set_description()
1780 object->length -= old_length; in FLAC__metadata_object_picture_set_description()
1781 object->length += new_length; in FLAC__metadata_object_picture_set_description()
1785 FLAC_API FLAC__bool FLAC__metadata_object_picture_set_data(FLAC__StreamMetadata *object, FLAC__byte… in FLAC__metadata_object_picture_set_data() argument
1789 FLAC__ASSERT(0 != object); in FLAC__metadata_object_picture_set_data()
1790 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_PICTURE); in FLAC__metadata_object_picture_set_data()
1793 old = object->data.picture.data; in FLAC__metadata_object_picture_set_data()
1797 if(!copy_bytes_(&object->data.picture.data, data, length)) in FLAC__metadata_object_picture_set_data()
1801 object->data.picture.data = data; in FLAC__metadata_object_picture_set_data()
1807 object->length -= object->data.picture.data_length; in FLAC__metadata_object_picture_set_data()
1808 object->data.picture.data_length = length; in FLAC__metadata_object_picture_set_data()
1809 object->length += length; in FLAC__metadata_object_picture_set_data()
1813 FLAC_API FLAC__bool FLAC__metadata_object_picture_is_legal(const FLAC__StreamMetadata *object, cons… in FLAC__metadata_object_picture_is_legal() argument
1815 FLAC__ASSERT(0 != object); in FLAC__metadata_object_picture_is_legal()
1816 FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_PICTURE); in FLAC__metadata_object_picture_is_legal()
1818 return FLAC__format_picture_is_legal(&object->data.picture, violation); in FLAC__metadata_object_picture_is_legal()