handle dsf file with odd samples when playing dop
Adrian Smith
9 years ago
248 | 248 | |
249 | 249 | frames = min(bytes, d->sample_bytes) / bytes_per_frame; |
250 | 250 | if (frames == 0) { |
251 | // /2 for dop should never result in 0 as header len is always even | |
252 | LOG_WARN("frames got to zero"); | |
253 | return DECODE_ERROR; | |
251 | if (dop && d->sample_bytes == 1 && bytes >= 2) { | |
252 | // 1 byte left add a byte of silence and play | |
253 | *(iptrl + 1) = *(iptrr + 1) = 0x69; | |
254 | frames = 1; | |
255 | } else { | |
256 | // should not get here due to wrapping m/2 for dop should never result in 0 as header len is always even | |
257 | LOG_INFO("frames got to zero"); | |
258 | return DECODE_COMPLETE; | |
259 | } | |
254 | 260 | } |
255 | 261 | |
256 | 262 | frames = min(frames, out); |