more consistent error report across examples

master
Rob Sykes 2013-01-18 08:09:09 +00:00
parent 7ad0e604af
commit 5ec11f4d5a
2 changed files with 4 additions and 4 deletions

View File

@ -37,10 +37,10 @@ int main(int argc, char const * arg[])
out, olen, &odone, /* Output. */
NULL, NULL, NULL); /* Default configuration.*/
unsigned i = 0; /* Print out the resampled data... */
unsigned i = 0; /* Print out the resampled data, */
while (i++ < odone)
printf("%5.2f%c", out[i-1], " \n"[!(i&7) || i == odone]);
puts(soxr_strerror(error)); /* ...and the reported result. */
printf("%-26s %s\n", arg[0], soxr_strerror(error)); /* and reported result. */
free(out); /* Tidy up. */
return !!error;

View File

@ -28,9 +28,9 @@ int main(int argc, char const * arg[])
data.src_ratio = orate / irate;
error = src_simple(&data, SRC_SINC_FASTEST, 1);
while (i++ < data.output_frames_gen) /* Print out the resampled data... */
while (i++ < data.output_frames_gen) /* Print out the resampled data, */
printf("%5.2f%c", out[i-1], " \n"[!(i&7) || i == data.output_frames_gen]);
puts(src_strerror(error)); /* ...and the reported result. */
printf("%-26s %s\n", arg[0], src_strerror(error)); /* and reported result. */
free(out); /* Tidy up. */
return !!error;