X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/a9f0ad12d639cdb5186f0482d2856278b41671a2..0e464e60978139f24c27ad22bd2a89329a06697c:/clients/playrtp-oss.c diff --git a/clients/playrtp-oss.c b/clients/playrtp-oss.c index 3c6312d..15f6b53 100644 --- a/clients/playrtp-oss.c +++ b/clients/playrtp-oss.c @@ -1,6 +1,7 @@ /* * This file is part of DisOrder. * Copyright (C) 2007 Richard Kettlewell + * Portions copyright (C) 2007 Ross Younger * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,6 +38,7 @@ #include #include #include +#include #include "mem.h" #include "log.h" @@ -137,6 +139,15 @@ static int playrtp_oss_flush(void) { if(nbyteswritten < playrtp_oss_bufsize) error(0, "%s: short write (%d/%d)", device, nbyteswritten, playrtp_oss_bufsize); + if(dump_buffer) { + int count; + const int16_t *sp = (const int16_t *)playrtp_oss_buffer; + + for(count = 0; count < playrtp_oss_bufsize; count += sizeof(int16_t)) { + dump_buffer[dump_index++] = (int16_t)ntohs(*sp++); + dump_index %= dump_size; + } + } playrtp_oss_bufused = 0; return 0; } @@ -178,7 +189,7 @@ static void playrtp_oss_disable(int hard) { /** @brief Write samples to OSS output device * @param data Pointer to sample data - * @param nsamples Number of samples + * @param samples Number of samples * @return 0 on success, non-0 on error */ static int playrtp_oss_write(const char *data, size_t samples) {