History

Some playback fixes

Tom Kistner committed 7 years ago

Commit 5cc918c1 parent c2705941 file · +3 −3Browse files

Unified · Split

Receivers/alsa/scream-alsa.c+3−3
@@ -121,7 +121,7 @@ static int close_alsa(snd_pcm_t *snd) { · 120 unmodified lines
121121 return 0;
122122 }
123123
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)
125125 {
126126 int i = 0;
127127 int ret;
@@ -214,7 +214,7 @@ int main(int argc, char *argv[]) · 86 unmodified lines
214214 rate = ((cur_server_rate >= 128) ? 44100 : 48000) * (cur_server_rate % 128);
215215 switch (cur_server_size) {
216216 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;
218218 case 32: format = SND_PCM_FORMAT_S32_LE; bytes_per_sample = 4; break;
219219 default:
220220 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
236236 if (!rate) continue;
237237
238238 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);
240240 }
241241 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t