X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/abf849cfd5389205704e9796133f72e59a03b7e3..b28bddbb2d2b2f07364153df3b980605d9caa9d9:/clients/playrtp-alsa.c diff --git a/clients/playrtp-alsa.c b/clients/playrtp-alsa.c index 263ab40..142f1ee 100644 --- a/clients/playrtp-alsa.c +++ b/clients/playrtp-alsa.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "mem.h" #include "log.h" @@ -141,6 +142,15 @@ static int playrtp_alsa_writei(const void *s, size_t n) { } else { /* Success */ next_timestamp += frames_written * 2; + if(dump_buffer) { + snd_pcm_sframes_t count; + const int16_t *sp = s; + + for(count = 0; count < frames_written * 2; ++count) { + dump_buffer[dump_index++] = (int16_t)ntohs(*sp++); + dump_index %= dump_size; + } + } return 0; } }