static void stream_decoder_metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) { StreamDecoderClientData *dcd = (StreamDecoderClientData*)client_data; (void)decoder; if(0 == dcd) { printf("ERROR: client_data in metadata callback is NULL\n"); return; } if(dcd->error_occurred) return; printf("%d... ", dcd->current_metadata_number); fflush(stdout); if(dcd->current_metadata_number >= num_expected_) { (void)die_("got more metadata blocks than expected"); dcd->error_occurred = true; } else { if(!mutils__compare_block(expected_metadata_sequence_[dcd->current_metadata_number], metadata)) { (void)die_("metadata block mismatch"); dcd->error_occurred = true; } } dcd->current_metadata_number++; }
static void stream_decoder_metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) { StreamDecoderClientData *dcd = (StreamDecoderClientData*)client_data; (void)decoder; if(0 == dcd) { printf("ERROR: client_data in metadata callback is NULL\n"); return; } if(dcd->error_occurred) return; if (metadata->type == FLAC__METADATA_TYPE_APPLICATION) { printf ("%d ('%c%c%c%c')... ", dcd->current_metadata_number, metadata->data.application.id [0], metadata->data.application.id [1], metadata->data.application.id [2], metadata->data.application.id [3]); } else { printf("%d... ", dcd->current_metadata_number); } fflush(stdout); if(dcd->current_metadata_number >= num_expected_) { (void)die_("got more metadata blocks than expected"); dcd->error_occurred = true; } else { if(!mutils__compare_block(expected_metadata_sequence_[dcd->current_metadata_number], metadata)) { (void)die_("metadata block mismatch"); dcd->error_occurred = true; } } dcd->current_metadata_number++; }