Unified · Split
| @@ -626,11 +626,14 @@ static const struct wave_format *wav_find_format(unsigned tag) · 625 unmodified lines | ||
| 626 | 626 | return NULL; |
| 627 | 627 | } |
| 628 | 628 | |
| 629 | −static int wavfail(sox_format_t *ft, int tag) | |
| 629 | +static int wavfail(sox_format_t *ft, int tag, const char *name) | |
| 630 | 630 | { |
| 631 | − lsx_fail_errno(ft, SOX_EHDR, | |
| 632 | − "WAV file encoding '%s' (%04x) is not supported", | |
| 633 | − wav_format_str(tag), tag); | |
| 631 | + if (name) | |
| 632 | + lsx_fail_errno(ft, SOX_EHDR, "WAVE format '%s' (%04x) not supported", | |
| 633 | + name, tag); | |
| 634 | + else | |
| 635 | + lsx_fail_errno(ft, SOX_EHDR, "Unknown WAVE format %04x", tag); | |
| 636 | + | |
| 634 | 637 | return SOX_EOF; |
| 635 | 638 | } |
| 636 | 639 | |
| @@ -721,7 +724,7 @@ static int wav_read_fmt(sox_format_t *ft, uint32_t len) · 84 unmodified lines | ||
| 721 | 724 | |
| 722 | 725 | fmt = wav_find_format(wav->formatTag); |
| 723 | 726 | if (!fmt) |
| 724 | − return wavfail(ft, wav->formatTag); | |
| 727 | + return wavfail(ft, wav->formatTag, NULL); | |
| 725 | 728 | |
| 726 | 729 | /* format handler might override */ |
| 727 | 730 | ft->encoding.encoding = fmt->encoding; |
| @@ -730,7 +733,7 @@ static int wav_read_fmt(sox_format_t *ft, uint32_t len) · 2 unmodified lines | ||
| 730 | 733 | if (fmt->read_fmt(ft, len)) |
| 731 | 734 | return SOX_EOF; |
| 732 | 735 | } else if (!fmt->encoding) { |
| 733 | − return wavfail(ft, wav->formatTag); | |
| 736 | + return wavfail(ft, wav->formatTag, fmt->name); | |
| 734 | 737 | } |
| 735 | 738 | |
| 736 | 739 | /* User options take precedence */ |