Lines Matching full:block1
696 static FLAC__bool compare_block_data_streaminfo_(const FLAC__StreamMetadata_StreamInfo *block1, const FLAC__StreamMetadata_StreamInfo *block2)
698 if(block1->min_blocksize != block2->min_blocksize)
700 if(block1->max_blocksize != block2->max_blocksize)
702 if(block1->min_framesize != block2->min_framesize)
704 if(block1->max_framesize != block2->max_framesize)
706 if(block1->sample_rate != block2->sample_rate)
708 if(block1->channels != block2->channels)
710 if(block1->bits_per_sample != block2->bits_per_sample)
712 if(block1->total_samples != block2->total_samples)
714 if(0 != memcmp(block1->md5sum, block2->md5sum, 16))
719 static FLAC__bool compare_block_data_application_(const FLAC__StreamMetadata_Application *block1, const FLAC__StreamMetadata_Application *block2, unsigned block_length)
721 FLAC__ASSERT(0 != block1);
723 FLAC__ASSERT(block_length >= sizeof(block1->id));
725 if(0 != memcmp(block1->id, block2->id, sizeof(block1->id)))
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;
733 static FLAC__bool compare_block_data_seektable_(const FLAC__StreamMetadata_SeekTable *block1, const FLAC__StreamMetadata_SeekTable *block2)
737 FLAC__ASSERT(0 != block1);
740 if(block1->num_points != block2->num_points)
743 if(0 != block1->points && 0 != block2->points) {
744 for(i = 0; i < block1->num_points; i++) {
745 if(block1->points[i].sample_number != block2->points[i].sample_number)
747 if(block1->points[i].stream_offset != block2->points[i].stream_offset)
749 if(block1->points[i].frame_samples != block2->points[i].frame_samples)
755 return block1->points == block2->points;
758 static FLAC__bool compare_block_data_vorbiscomment_(const FLAC__StreamMetadata_VorbisComment *block1, const FLAC__StreamMetadata_VorbisComment *block2)
762 if(block1->vendor_string.length != block2->vendor_string.length)
765 if(0 != block1->vendor_string.entry && 0 != block2->vendor_string.entry) {
766 if(0 != memcmp(block1->vendor_string.entry, block2->vendor_string.entry, block1->vendor_string.length))
769 else if(block1->vendor_string.entry != block2->vendor_string.entry)
772 if(block1->num_comments != block2->num_comments)
775 for(i = 0; i < block1->num_comments; i++) {
776 if(0 != block1->comments[i].entry && 0 != block2->comments[i].entry) {
777 if(0 != memcmp(block1->comments[i].entry, block2->comments[i].entry, block1->comments[i].length))
780 else if(block1->comments[i].entry != block2->comments[i].entry)
786 static FLAC__bool compare_block_data_cuesheet_(const FLAC__StreamMetadata_CueSheet *block1, const FLAC__StreamMetadata_CueSheet *block2)
790 if(0 != strcmp(block1->media_catalog_number, block2->media_catalog_number))
793 if(block1->lead_in != block2->lead_in)
796 if(block1->is_cd != block2->is_cd)
799 if(block1->num_tracks != block2->num_tracks)
802 if(0 != block1->tracks && 0 != block2->tracks) {
803 FLAC__ASSERT(block1->num_tracks > 0);
804 for(i = 0; i < block1->num_tracks; i++) {
805 if(block1->tracks[i].offset != block2->tracks[i].offset)
807 if(block1->tracks[i].number != block2->tracks[i].number)
809 if(0 != memcmp(block1->tracks[i].isrc, block2->tracks[i].isrc, sizeof(block1->tracks[i].isrc)))
811 if(block1->tracks[i].type != block2->tracks[i].type)
813 if(block1->tracks[i].pre_emphasis != block2->tracks[i].pre_emphasis)
815 if(block1->tracks[i].num_indices != block2->tracks[i].num_indices)
817 if(0 != block1->tracks[i].indices && 0 != block2->tracks[i].indices) {
818 FLAC__ASSERT(block1->tracks[i].num_indices > 0);
819 for(j = 0; j < block1->tracks[i].num_indices; j++) {
820 if(block1->tracks[i].indices[j].offset != block2->tracks[i].indices[j].offset)
822 if(block1->tracks[i].indices[j].number != block2->tracks[i].indices[j].number)
826 else if(block1->tracks[i].indices != block2->tracks[i].indices)
830 else if(block1->tracks != block2->tracks)
835 static FLAC__bool compare_block_data_picture_(const FLAC__StreamMetadata_Picture *block1, const FLAC__StreamMetadata_Picture *block2)
837 if(block1->type != block2->type)
839 if(block1->mime_type != block2->mime_type && (0 == block1->mime_type || 0 == block2->mime_type || strcmp(block1->mime_type, block2->mime_type)))
841 if(block1->description != block2->description && (0 == block1->description || 0 == block2->description || strcmp((const char *)block1->description, (const char *)block2->description)))
843 if(block1->width != block2->width)
845 if(block1->height != block2->height)
847 if(block1->depth != block2->depth)
849 if(block1->colors != block2->colors)
851 if(block1->data_length != block2->data_length)
853 if(block1->data != block2->data && (0 == block1->data || 0 == block2->data || memcmp(block1->data, block2->data, block1->data_length)))
858 static FLAC__bool compare_block_data_unknown_(const FLAC__StreamMetadata_Unknown *block1, const FLAC__StreamMetadata_Unknown *block2, unsigned block_length)
860 FLAC__ASSERT(0 != block1);
863 if(0 != block1->data && 0 != block2->data)
864 return 0 == memcmp(block1->data, block2->data, block_length);
866 return block1->data == block2->data;
869 FLAC_API FLAC__bool FLAC__metadata_object_is_equal(const FLAC__StreamMetadata *block1, const FLAC__StreamMetadata *block2)
871 FLAC__ASSERT(0 != block1);
874 if(block1->type != block2->type) {
877 if(block1->is_last != block2->is_last) {
880 if(block1->length != block2->length) {
883 switch(block1->type) {
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);