Unified · Split
| @@ -121,7 +121,7 @@ static int close_alsa(snd_pcm_t *snd) { · 120 unmodified lines | ||
| 121 | 121 | return 0; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | −static int write_frames(snd_pcm_t *snd, unsigned char buf[MAX_SO_PACKETSIZE], int total_frames, int bytes_per_sample) | |
| 124 | +static int write_frames(snd_pcm_t *snd, unsigned char buf[MAX_SO_PACKETSIZE-2], int total_frames, int bytes_per_sample) | |
| 125 | 125 | { |
| 126 | 126 | int i = 0; |
| 127 | 127 | int ret; |
| @@ -214,7 +214,7 @@ int main(int argc, char *argv[]) · 86 unmodified lines | ||
| 214 | 214 | rate = ((cur_server_rate >= 128) ? 44100 : 48000) * (cur_server_rate % 128); |
| 215 | 215 | switch (cur_server_size) { |
| 216 | 216 | case 16: format = SND_PCM_FORMAT_S16_LE; bytes_per_sample = 2; break; |
| 217 | − case 24: format = SND_PCM_FORMAT_S24_LE; bytes_per_sample = 3; break; | |
| 217 | + case 24: format = SND_PCM_FORMAT_S24_3LE; bytes_per_sample = 3; break; | |
| 218 | 218 | case 32: format = SND_PCM_FORMAT_S32_LE; bytes_per_sample = 4; break; |
| 219 | 219 | default: |
| 220 | 220 | printf("Unsupported sample size %hhu, not playing until next format switch.\n", cur_server_size); |
| @@ -236,6 +236,6 @@ int main(int argc, char *argv[]) · 15 unmodified lines | ||
| 236 | 236 | if (!rate) continue; |
| 237 | 237 | |
| 238 | 238 | samples = (n - 2) / (bytes_per_sample * CHANNELS); |
| 239 | − write_frames(snd, buf, samples, bytes_per_sample); | |
| 239 | + write_frames(snd, &buf[2], samples, bytes_per_sample); | |
| 240 | 240 | } |
| 241 | 241 | } |