Home | History | Annotate | Download | only in libFLAC

Lines Matching full:data

25  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
167 object->length = object->data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
197 object->length += object->data.vorbis_comment.vendor_string.length;
199 for(i = 0; i < object->data.vorbis_comment.num_comments; i++) {
201 object->length += object->data.vorbis_comment.comments[i].length;
303 for(i = offset; i < object->data.vorbis_comment.num_comments; i++) {
304 if(FLAC__metadata_object_vorbiscomment_entry_matches(object->data.vorbis_comment.comments[i], field_name, field_name_length))
325 object->length += object->data.cue_sheet.num_tracks * (
335 for(i = 0; i < object->data.cue_sheet.num_tracks; i++) {
336 object->length += object->data.cue_sheet.tracks[i].num_indices * (
456 object->data.application.data = 0;
462 object->data.seek_table.num_points = 0;
463 object->data.seek_table.points = 0;
467 object->data.vorbis_comment.vendor_string.length = (unsigned)strlen(FLAC__VENDOR_STRING);
468 if(!copy_bytes_(&object->data.vorbis_comment.vendor_string.entry, (const FLAC__byte*)FLAC__VENDOR_STRING, object->data.vorbis_comment.vendor_string.length+1)) {
487 0 /* no data */
489 object->data.picture.type = FLAC__STREAM_METADATA_PICTURE_TYPE_OTHER;
490 object->data.picture.mime_type = 0;
491 object->data.picture.description = 0;
493 object->data.picture.width = 0;
494 object->data.picture.height = 0;
495 object->data.picture.depth = 0;
496 object->data.picture.colors = 0;
497 object->data.picture.data_length = 0;
498 object->data.picture.data = 0;
501 if(!copy_cstring_(&object->data.picture.mime_type, "")) {
505 if(!copy_cstring_((char**)(&object->data.picture.description), "")) {
506 if(object->data.picture.mime_type)
507 free(object->data.picture.mime_type);
515 object->data.unknown.data = 0;
536 memcpy(&to->datadata.stream_info, sizeof(FLAC__StreamMetadata_StreamInfo));
545 memcpy(&to->data.application.id, &object->data.application.id, FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8);
546 if(!copy_bytes_(&to->data.application.data, object->data.application.data, object->length - FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8)) {
552 to->data.seek_table.num_points = object->data.seek_table.num_points;
553 if(to->data.seek_table.num_points > SIZE_MAX / sizeof(FLAC__StreamMetadata_SeekPoint)) { /* overflow check */
557 if(!copy_bytes_((FLAC__byte**)&to->data.seek_table.points, (FLAC__byte*)object->data.seek_table.points, object->data.seek_table.num_points * sizeof(FLAC__StreamMetadata_SeekPoint))) {
563 if(0 != to->data.vorbis_comment.vendor_string.entry) {
564 free(to->data.vorbis_comment.vendor_string.entry);
565 to->data.vorbis_comment.vendor_string.entry = 0;
567 if(!copy_vcentry_(&to->data.vorbis_comment.vendor_string, &object->data.vorbis_comment.vendor_string)) {
571 if(object->data.vorbis_comment.num_comments == 0) {
572 FLAC__ASSERT(0 == object->data.vorbis_comment.comments);
573 to->data.vorbis_comment.comments = 0;
576 FLAC__ASSERT(0 != object->data.vorbis_comment.comments);
577 to->data.vorbis_comment.comments = vorbiscomment_entry_array_copy_(object->data.vorbis_comment.comments, object->data.vorbis_comment.num_comments);
578 if(0 == to->data.vorbis_comment.comments) {
583 to->data.vorbis_comment.num_comments = object->data.vorbis_comment.num_comments;
586 memcpy(&to->data.cue_sheet, &object->data.cue_sheet, sizeof(FLAC__StreamMetadata_CueSheet));
587 if(object->data.cue_sheet.num_tracks == 0) {
588 FLAC__ASSERT(0 == object->data.cue_sheet.tracks);
591 FLAC__ASSERT(0 != object->data.cue_sheet.tracks);
592 to->data.cue_sheet.tracks = cuesheet_track_array_copy_(object->data.cue_sheet.tracks, object->data.cue_sheet.num_tracks);
593 if(0 == to->data.cue_sheet.tracks) {
600 to->data.picture.type = object->data.picture.type;
601 if(!copy_cstring_(&to->data.picture.mime_type, object->data.picture.mime_type)) {
605 if(!copy_cstring_((char**)(&to->data.picture.description), (const char*)object->data.picture.description)) {
609 to->data.picture.width = object->data.picture.width;
610 to->data.picture.height = object->data.picture.height;
611 to->data.picture.depth = object->data.picture.depth;
612 to->data.picture.colors = object->data.picture.colors;
613 to->data.picture.data_length = object->data.picture.data_length;
614 if(!copy_bytes_((&to->data.picture.data), object->data.picture.data, object->data.picture.data_length)) {
620 if(!copy_bytes_(&to->data.unknown.data, object->data.unknown.data, object->length)) {
640 if(0 != object->data.application.data) {
641 free(object->data.application.data);
642 object->data.application.data = 0;
646 if(0 != object->data.seek_table.points) {
647 free(object->data.seek_table.points);
648 object->data.seek_table.points = 0;
652 if(0 != object->data.vorbis_comment.vendor_string.entry) {
653 free(object->data.vorbis_comment.vendor_string.entry);
654 object->data.vorbis_comment.vendor_string.entry = 0;
656 if(0 != object->data.vorbis_comment.comments) {
657 FLAC__ASSERT(object->data.vorbis_comment.num_comments > 0);
658 vorbiscomment_entry_array_delete_(object->data.vorbis_comment.comments, object->data.vorbis_comment.num_comments);
662 if(0 != object->data.cue_sheet.tracks) {
663 FLAC__ASSERT(object->data.cue_sheet.num_tracks > 0);
664 cuesheet_track_array_delete_(object->data.cue_sheet.tracks, object->data.cue_sheet.num_tracks);
668 if(0 != object->data.picture.mime_type) {
669 free(object->data.picture.mime_type);
670 object->data.picture.mime_type = 0;
672 if(0 != object->data.picture.description) {
673 free(object->data.picture.description);
674 object->data.picture.description = 0;
676 if(0 != object->data.picture.data) {
677 free(object->data.picture.data);
678 object->data.picture.data = 0;
682 if(0 != object->data.unknown.data) {
683 free(object->data.unknown.data);
684 object->data.unknown.data = 0;
727 if(0 != block1->data && 0 != block2->data)
728 return 0 == memcmp(block1->data, block2->data, block_length - sizeof(block1->id));
730 return block1->data == block2->data;
853 if(block1->data != block2->data && (0 == block1->data || 0 == block2->data || memcmp(block1->data, block2->data, block1->data_length)))
863 if(0 != block1->data && 0 != block2->data)
864 return 0 == memcmp(block1->data, block2->data, block_length);
866 return block1->data == block2->data;
885 return compare_block_data_streaminfo_(&block1->data.stream_info, &block2->data.stream_info);
889 return compare_block_data_application_(&block1->data.application, &block2->data.application, block1->length);
891 return compare_block_data_seektable_(&block1->data.seek_table, &block2->data.seek_table);
893 return compare_block_data_vorbiscomment_(&block1->data.vorbis_comment, &block2->data.vorbis_comment);
895 return compare_block_data_cuesheet_(&block1->data.cue_sheet, &block2->data.cue_sheet);
897 return compare_block_data_picture_(&block1->data.picture, &block2->data.picture);
899 return compare_block_data_unknown_(&block1->data.unknown, &block2->data.unknown, block1->length);
903 FLAC_API FLAC__bool FLAC__metadata_object_application_set_data(FLAC__StreamMetadata *object, FLAC__byte *data, unsigned length, FLAC__bool copy)
909 FLAC__ASSERT((0 != data && length > 0) || (0 == data && length == 0 && copy == false));
911 save = object->data.application.data;
915 if(!copy_bytes_(&object->data.application.data, data, length))
919 object->data.application.data = data;
934 if(0 == object->data.seek_table.points) {
935 FLAC__ASSERT(object->data.seek_table.num_points == 0);
938 else if(0 == (object->data.seek_table.points = seekpoint_array_new_(new_num_points)))
942 const size_t old_size = object->data.seek_table.num_points * sizeof(FLAC__StreamMetadata_SeekPoint);
949 FLAC__ASSERT(object->data.seek_table.num_points > 0);
952 free(object->data.seek_table.points);
953 object->data.seek_table.points = 0;
955 else if(0 == (object->data.seek_table.points = (FLAC__StreamMetadata_SeekPoint*)realloc(object->data.seek_table.points, new_size)))
961 for(i = object->data.seek_table.num_points; i < new_num_points; i++) {
962 object->data.seek_table.points[i].sample_number = FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER;
963 object->data.seek_table.points[i].stream_offset = 0;
964 object->data.seek_table.points[i].frame_samples = 0;
969 object->data.seek_table.num_points = new_num_points;
979 FLAC__ASSERT(point_num < object->data.seek_table.num_points);
981 object->data.seek_table.points[point_num] = point;
990 FLAC__ASSERT(point_num <= object->data.seek_table.num_points);
992 if(!FLAC__metadata_object_seektable_resize_points(object, object->data.seek_table.num_points+1))
996 for(i = (int)object->data.seek_table.num_points-1; i > (int)point_num; i--)
997 object->data.seek_table.points[i] = object->data.seek_table.points[i-1];
1010 FLAC__ASSERT(point_num < object->data.seek_table.num_points);
1013 for(i = point_num; i < object->data.seek_table.num_points-1; i++)
1014 object->data.seek_table.points[i] = object->data.seek_table.points[i+1];
1016 return FLAC__metadata_object_seektable_resize_points(object, object->data.seek_table.num_points-1);
1024 return FLAC__format_seektable_is_legal(&object->data.seek_table);
1034 return FLAC__metadata_object_seektable_resize_points(object, object->data.seek_table.num_points + num);
1046 seek_table = &object->data.seek_table;
1065 FLAC__StreamMetadata_SeekTable *seek_table = &object->data.seek_table;
1090 FLAC__StreamMetadata_SeekTable *seek_table = &object->data.seek_table;
1116 FLAC__StreamMetadata_SeekTable *seek_table = &object->data.seek_table;
1148 unique = FLAC__format_seektable_sort(&object->data.seek_table);
1157 return vorbiscomment_set_entry_(object, &object->data.vorbis_comment.vendor_string, &entry, copy);
1165 if(0 == object->data.vorbis_comment.comments) {
1166 FLAC__ASSERT(object->data.vorbis_comment.num_comments == 0);
1169 else if(0 == (object->data.vorbis_comment.comments = vorbiscomment_entry_array_new_(new_num_comments)))
1173 const size_t old_size = object->data.vorbis_comment.num_comments * sizeof(FLAC__StreamMetadata_VorbisComment_Entry);
1180 FLAC__ASSERT(object->data.vorbis_comment.num_comments > 0);
1183 if(new_num_comments < object->data.vorbis_comment.num_comments) {
1185 for(i = new_num_comments; i < object->data.vorbis_comment.num_comments; i++)
1186 if(0 != object->data.vorbis_comment.comments[i].entry)
1187 free(object->data.vorbis_comment.comments[i].entry);
1191 free(object->data.vorbis_comment.comments);
1192 object->data.vorbis_comment.comments = 0;
1194 else if(0 == (object->data.vorbis_comment.comments = (FLAC__StreamMetadata_VorbisComment_Entry*)realloc(object->data.vorbis_comment.comments, new_size)))
1199 memset(object->data.vorbis_comment.comments + object->data.vorbis_comment.num_comments, 0, new_size - old_size);
1202 object->data.vorbis_comment.num_comments = new_num_comments;
1211 FLAC__ASSERT(comment_num < object->data.vorbis_comment.num_comments);
1215 return vorbiscomment_set_entry_(object, &object->data.vorbis_comment.comments[comment_num], &entry, copy);
1224 FLAC__ASSERT(comment_num <= object->data.vorbis_comment.num_comments);
1229 vc = &object->data.vorbis_comment;
1246 return FLAC__metadata_object_vorbiscomment_insert_comment(object, object->data.vorbis_comment.num_comments, entry, copy);
1272 if(all && (index+1 < object->data.vorbis_comment.num_comments)) {
1276 if((unsigned)i < object->data.vorbis_comment.num_comments)
1295 FLAC__ASSERT(comment_num < object->data.vorbis_comment.num_comments);
1297 vc = &object->data.vorbis_comment;
1398 for(i = 0; i < object->data.vorbis_comment.num_comments; i++) {
1399 if(FLAC__metadata_object_vorbiscomment_entry_matches(object->data.vorbis_comment.comments[i], field_name, field_name_length)) {
1421 for(i = (int)object->data.vorbis_comment.num_comments - 1; ok && i >= 0; i--) {
1422 if(FLAC__metadata_object_vorbiscomment_entry_matches(object->data.vorbis_comment.comments[i], field_name, field_name_length)) {
1473 FLAC__ASSERT(track_num < object->data.cue_sheet.num_tracks);
1475 track = &object->data.cue_sheet.tracks[track_num];
1518 FLAC__ASSERT(track_num < object->data.cue_sheet.num_tracks);
1519 FLAC__ASSERT(index_num <= object->data.cue_sheet.tracks[track_num].num_indices);
1521 track = &object->data.cue_sheet.tracks[track_num];
1547 FLAC__ASSERT(track_num < object->data.cue_sheet.num_tracks);
1548 FLAC__ASSERT(index_num < object->data.cue_sheet.tracks[track_num].num_indices);
1550 track = &object->data.cue_sheet.tracks[track_num];
1565 if(0 == object->data.cue_sheet.tracks) {
1566 FLAC__ASSERT(object->data.cue_sheet.num_tracks == 0);
1569 else if(0 == (object->data.cue_sheet.tracks = cuesheet_track_array_new_(new_num_tracks)))
1573 const size_t old_size = object->data.cue_sheet.num_tracks * sizeof(FLAC__StreamMetadata_CueSheet_Track);
1580 FLAC__ASSERT(object->data.cue_sheet.num_tracks > 0);
1583 if(new_num_tracks < object->data.cue_sheet.num_tracks) {
1585 for(i = new_num_tracks; i < object->data.cue_sheet.num_tracks; i++)
1586 if(0 != object->data.cue_sheet.tracks[i].indices)
1587 free(object->data.cue_sheet.tracks[i].indices);
1591 free(object->data.cue_sheet.tracks);
1592 object->data.cue_sheet.tracks = 0;
1594 else if(0 == (object->data.cue_sheet.tracks = (FLAC__StreamMetadata_CueSheet_Track*)realloc(object->data.cue_sheet.tracks, new_size)))
1599 memset(object->data.cue_sheet.tracks + object->data.cue_sheet.num_tracks, 0, new_size - old_size);
1602 object->data.cue_sheet.num_tracks = new_num_tracks;
1611 FLAC__ASSERT(track_num < object->data.cue_sheet.num_tracks);
1613 return cuesheet_set_track_(object, object->data.cue_sheet.tracks + track_num, track, copy);
1622 FLAC__ASSERT(track_num <= object->data.cue_sheet.num_tracks);
1624 cs = &object->data.cue_sheet;
1650 FLAC__ASSERT(track_num < object->data.cue_sheet.num_tracks);
1652 cs = &object->data.cue_sheet;
1671 return FLAC__format_cuesheet_is_legal(&object->data.cue_sheet, check_cd_da_subset, violation);
1706 cs = &object->data.cue_sheet;
1730 old = object->data.picture.mime_type;
1738 if(!copy_bytes_((FLAC__byte**)(&object->data.picture.mime_type), (FLAC__byte*)mime_type, new_length+1))
1742 object->data.picture.mime_type = mime_type;
1762 old = object->data.picture.description;
1770 if(!copy_bytes_(&object->data.picture.description, description, new_length+1))
1774 object->data.picture.description = description;
1785 FLAC_API FLAC__bool FLAC__metadata_object_picture_set_data(FLAC__StreamMetadata *object, FLAC__byte *data, FLAC__uint32 length, FLAC__bool copy)
1791 FLAC__ASSERT((0 != data && length > 0) || (0 == data && length == 0 && copy == false));
1793 old = object->data.picture.data;
1797 if(!copy_bytes_(&object->data.picture.data, data, length))
1801 object->data.picture.data = data;
1807 object->length -= object->data.picture.data_length;
1808 object->data.picture.data_length = length;
1818 return FLAC__format_picture_is_legal(&object->data.picture, violation);