decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR;
return false;
}
- approx_bytes_per_frame = 2 * (upper_bound - pos) / 3 + 16;
+ approx_bytes_per_frame = (unsigned)(2 * (upper_bound - pos) / 3 + 16);
}
else {
/* target_sample >= this_frame_sample + this frame's blocksize */
decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR;
return false;
}
- approx_bytes_per_frame = 2 * (lower_bound - pos) / 3 + 16;
+ approx_bytes_per_frame = (unsigned)(2 * (lower_bound - pos) / 3 + 16);
}
}
printf("testing get_total_samples_estimate()... ");
if(encoder->get_total_samples_estimate() != streaminfo_.data.stream_info.total_samples) {
+#ifdef _MSC_VER
+ printf("FAILED, expected %I64u, got %I64u\n", streaminfo_.data.stream_info.total_samples, encoder->get_total_samples_estimate());
+#else
printf("FAILED, expected %llu, got %llu\n", (unsigned long long)streaminfo_.data.stream_info.total_samples, (unsigned long long)encoder->get_total_samples_estimate());
+#endif
return false;
}
printf("OK\n");
printf("testing FLAC__stream_encoder_get_total_samples_estimate()... ");
if(FLAC__stream_encoder_get_total_samples_estimate(encoder) != streaminfo_.data.stream_info.total_samples) {
+#ifdef _MSC_VER
+ printf("FAILED, expected %I64u, got %I64u\n", streaminfo_.data.stream_info.total_samples, FLAC__stream_encoder_get_total_samples_estimate(encoder));
+#else
printf("FAILED, expected %llu, got %llu\n", (unsigned long long)streaminfo_.data.stream_info.total_samples, (unsigned long long)FLAC__stream_encoder_get_total_samples_estimate(encoder));
+#endif
return false;
}
printf("OK\n");
unsigned i;
if(from->offset != to->offset) {
+#ifdef _MSC_VER
+ printf("FAILED, track offset mismatch, expected %I64u, got %I64u\n", to->offset, from->offset);
+#else
printf("FAILED, track offset mismatch, expected %llu, got %llu\n", (unsigned long long)to->offset, (unsigned long long)from->offset);
+#endif
return false;
}
if(from->number != to->number) {
else {
for(i = 0; i < to->num_indices; i++) {
if(from->indices[i].offset != to->indices[i].offset) {
+#ifdef _MSC_VER
+ printf("FAILED, track indices[%u].offset mismatch, expected %I64u, got %I64u\n", i, to->indices[i].offset, from->indices[i].offset);
+#else
printf("FAILED, track indices[%u].offset mismatch, expected %llu, got %llu\n", i, (unsigned long long)to->indices[i].offset, (unsigned long long)from->indices[i].offset);
+#endif
return false;
}
if(from->indices[i].number != to->indices[i].number) {
for(i = 0; i < n; i++) {
if(from[i].sample_number != to[i].sample_number) {
+#ifdef _MSC_VER
+ printf("FAILED, point[%u].sample_number mismatch, expected %I64u, got %I64u\n", i, to[i].sample_number, from[i].sample_number);
+#else
printf("FAILED, point[%u].sample_number mismatch, expected %llu, got %llu\n", i, (unsigned long long)to[i].sample_number, (unsigned long long)from[i].sample_number);
+#endif
return false;
}
if(from[i].stream_offset != to[i].stream_offset) {
+#ifdef _MSC_VER
+ printf("FAILED, point[%u].stream_offset mismatch, expected %I64u, got %I64u\n", i, to[i].stream_offset, from[i].stream_offset);
+#else
printf("FAILED, point[%u].stream_offset mismatch, expected %llu, got %llu\n", i, (unsigned long long)to[i].stream_offset, (unsigned long long)from[i].stream_offset);
+#endif
return false;
}
if(from[i].frame_samples != to[i].frame_samples) {
return false;
}
if(blockcopy->total_samples != block->total_samples) {
+#ifdef _MSC_VER
+ printf("FAILED, total_samples mismatch, expected %I64u, got %I64u\n", block->total_samples, blockcopy->total_samples);
+#else
printf("FAILED, total_samples mismatch, expected %llu, got %llu\n", (unsigned long long)block->total_samples, (unsigned long long)blockcopy->total_samples);
+#endif
return false;
}
if(0 != memcmp(blockcopy->md5sum, block->md5sum, sizeof(block->md5sum))) {
}
for(i = 0; i < block->num_points; i++) {
if(blockcopy->points[i].sample_number != block->points[i].sample_number) {
+#ifdef _MSC_VER
+ printf("FAILED, points[%u].sample_number mismatch, expected %I64u, got %I64u\n", i, block->points[i].sample_number, blockcopy->points[i].sample_number);
+#else
printf("FAILED, points[%u].sample_number mismatch, expected %llu, got %llu\n", i, (unsigned long long)block->points[i].sample_number, (unsigned long long)blockcopy->points[i].sample_number);
+#endif
return false;
}
if(blockcopy->points[i].stream_offset != block->points[i].stream_offset) {
+#ifdef _MSC_VER
+ printf("FAILED, points[%u].stream_offset mismatch, expected %I64u, got %I64u\n", i, block->points[i].stream_offset, blockcopy->points[i].stream_offset);
+#else
printf("FAILED, points[%u].stream_offset mismatch, expected %llu, got %llu\n", i, (unsigned long long)block->points[i].stream_offset, (unsigned long long)blockcopy->points[i].stream_offset);
+#endif
return false;
}
if(blockcopy->points[i].frame_samples != block->points[i].frame_samples) {
return false;
}
if(blockcopy->lead_in != block->lead_in) {
+#ifdef _MSC_VER
+ printf("FAILED, lead_in mismatch, expected %I64u, got %I64u\n", block->lead_in, blockcopy->lead_in);
+#else
printf("FAILED, lead_in mismatch, expected %llu, got %llu\n", (unsigned long long)block->lead_in, (unsigned long long)blockcopy->lead_in);
+#endif
return false;
}
if(blockcopy->is_cd != block->is_cd) {
}
for(i = 0; i < block->num_tracks; i++) {
if(blockcopy->tracks[i].offset != block->tracks[i].offset) {
+#ifdef _MSC_VER
+ printf("FAILED, tracks[%u].offset mismatch, expected %I64u, got %I64u\n", i, block->tracks[i].offset, blockcopy->tracks[i].offset);
+#else
printf("FAILED, tracks[%u].offset mismatch, expected %llu, got %llu\n", i, (unsigned long long)block->tracks[i].offset, (unsigned long long)blockcopy->tracks[i].offset);
+#endif
return false;
}
if(blockcopy->tracks[i].number != block->tracks[i].number) {
else {
for(j = 0; j < block->tracks[i].num_indices; j++) {
if(blockcopy->tracks[i].indices[j].offset != block->tracks[i].indices[j].offset) {
+#ifdef _MSC_VER
+ printf("FAILED, tracks[%u].indices[%u].offset mismatch, expected %I64u, got %I64u\n", i, j, block->tracks[i].indices[j].offset, blockcopy->tracks[i].indices[j].offset);
+#else
printf("FAILED, tracks[%u].indices[%u].offset mismatch, expected %llu, got %llu\n", i, j, (unsigned long long)block->tracks[i].indices[j].offset, (unsigned long long)blockcopy->tracks[i].indices[j].offset);
+#endif
return false;
}
if(blockcopy->tracks[i].indices[j].number != block->tracks[i].indices[j].number) {
}
else if (frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER) {
if (!dcd->quiet)
+#ifdef _MSC_VER
+ printf("frame@%I64u(%u)... ", frame->header.number.sample_number, frame->header.blocksize);
+#else
printf("frame@%llu(%u)... ", (unsigned long long)frame->header.number.sample_number, frame->header.blocksize);
+#endif
}
else {
FLAC__ASSERT(0);
return die_s_("expected FLAC__STREAM_DECODER_END_OF_STREAM", decoder);
}
+#ifdef _MSC_VER
+ printf("file's total_samples is %I64u\n", decoder_client_data.total_samples);
+#else
printf("file's total_samples is %llu\n", (unsigned long long)decoder_client_data.total_samples);
+#endif
#if !defined _MSC_VER && !defined __MINGW32__ && !defined __EMX__
if (decoder_client_data.total_samples > (FLAC__uint64)RAND_MAX) {
printf("ERROR: must be total_samples < %u\n", (unsigned)RAND_MAX);
#endif
}
+#ifdef _MSC_VER
+ printf("seek(%I64u)... ", pos);
+#else
printf("seek(%llu)... ", (unsigned long long)pos);
+#endif
fflush(stdout);
if(!FLAC__stream_decoder_seek_absolute(decoder, pos)) {
if(pos < (FLAC__uint64)n && decoder_client_data.total_samples != 0)