wavpack: obey all decoder commands, stop at CUE track border
It used to ignore the decoder_data() return value.
This commit is contained in:
parent
4c4f8bf02a
commit
2e28ed8f81
1
NEWS
1
NEWS
|
@ -4,6 +4,7 @@ ver 0.16.4 (2011/??/??)
|
||||||
* decoder:
|
* decoder:
|
||||||
- ffmpeg: workaround for semantic API change in recent ffmpeg versions
|
- ffmpeg: workaround for semantic API change in recent ffmpeg versions
|
||||||
- flac: validate the sample rate when scanning the tag
|
- flac: validate the sample rate when scanning the tag
|
||||||
|
- wavpack: obey all decoder commands, stop at CUE track border
|
||||||
* output:
|
* output:
|
||||||
- alsa: fix SIGFPE when alsa announces a period size of 0
|
- alsa: fix SIGFPE when alsa announces a period size of 0
|
||||||
|
|
||||||
|
|
|
@ -194,8 +194,9 @@ wavpack_decode(struct decoder *decoder, WavpackContext *wpc, bool can_seek)
|
||||||
|
|
||||||
decoder_initialized(decoder, &audio_format, can_seek, total_time);
|
decoder_initialized(decoder, &audio_format, can_seek, total_time);
|
||||||
|
|
||||||
while (true) {
|
enum decoder_command cmd = decoder_get_command(decoder);
|
||||||
if (decoder_get_command(decoder) == DECODE_COMMAND_SEEK) {
|
while (cmd != DECODE_COMMAND_STOP) {
|
||||||
|
if (cmd == DECODE_COMMAND_SEEK) {
|
||||||
if (can_seek) {
|
if (can_seek) {
|
||||||
unsigned where = decoder_seek_where(decoder) *
|
unsigned where = decoder_seek_where(decoder) *
|
||||||
audio_format.sample_rate;
|
audio_format.sample_rate;
|
||||||
|
@ -210,10 +211,6 @@ wavpack_decode(struct decoder *decoder, WavpackContext *wpc, bool can_seek)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (decoder_get_command(decoder) == DECODE_COMMAND_STOP) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t samples_got = WavpackUnpackSamples(wpc, chunk,
|
uint32_t samples_got = WavpackUnpackSamples(wpc, chunk,
|
||||||
samples_requested);
|
samples_requested);
|
||||||
if (samples_got == 0)
|
if (samples_got == 0)
|
||||||
|
@ -224,9 +221,9 @@ wavpack_decode(struct decoder *decoder, WavpackContext *wpc, bool can_seek)
|
||||||
format_samples(bytes_per_sample, chunk,
|
format_samples(bytes_per_sample, chunk,
|
||||||
samples_got * audio_format.channels);
|
samples_got * audio_format.channels);
|
||||||
|
|
||||||
decoder_data(decoder, NULL, chunk,
|
cmd = decoder_data(decoder, NULL, chunk,
|
||||||
samples_got * output_sample_size,
|
samples_got * output_sample_size,
|
||||||
bitrate);
|
bitrate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue