X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/c593cf7c8a1ea63fc107b810bdb167487f71380e..b4a80f69edc156b91cd19c2175078b7cc940ed0f:/clients/playrtp-alsa.c diff --git a/clients/playrtp-alsa.c b/clients/playrtp-alsa.c index ceea87b..142f1ee 100644 --- a/clients/playrtp-alsa.c +++ b/clients/playrtp-alsa.c @@ -23,13 +23,14 @@ #include -#if API_ALSA +#if HAVE_ALSA_ASOUNDLIB_H #include "types.h" #include #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; } }