buffer.c (113752) | buffer.c (119853) |
---|---|
1/* | 1/* |
2 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk> | 2 * Copyright (c) 1999 Cameron Grant <cg@freebsd.org> |
3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright --- 12 unchanged lines hidden (view full) --- 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <dev/sound/pcm/sound.h> 28 29#include "feeder_if.h" 30 | 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright --- 12 unchanged lines hidden (view full) --- 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <dev/sound/pcm/sound.h> 28 29#include "feeder_if.h" 30 |
31SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pcm/buffer.c 113752 2003-04-20 17:08:56Z orion $"); | 31SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pcm/buffer.c 119853 2003-09-07 16:28:03Z cg $"); |
32 33struct snd_dbuf * 34sndbuf_create(device_t dev, char *drv, char *desc) 35{ 36 struct snd_dbuf *b; 37 38 b = malloc(sizeof(*b), M_DEVBUF, M_WAITOK | M_ZERO); 39 snprintf(b->name, SNDBUF_NAMELEN, "%s:%s", drv, desc); --- 84 unchanged lines hidden (view full) --- 124 return EINVAL; 125 if (blkcnt == b->blkcnt && blksz == b->blksz) 126 return 0; 127 b->blkcnt = blkcnt; 128 b->blksz = blksz; 129 b->bufsize = blkcnt * blksz; 130 131 tmpbuf = malloc(b->bufsize, M_DEVBUF, M_NOWAIT); | 32 33struct snd_dbuf * 34sndbuf_create(device_t dev, char *drv, char *desc) 35{ 36 struct snd_dbuf *b; 37 38 b = malloc(sizeof(*b), M_DEVBUF, M_WAITOK | M_ZERO); 39 snprintf(b->name, SNDBUF_NAMELEN, "%s:%s", drv, desc); --- 84 unchanged lines hidden (view full) --- 124 return EINVAL; 125 if (blkcnt == b->blkcnt && blksz == b->blksz) 126 return 0; 127 b->blkcnt = blkcnt; 128 b->blksz = blksz; 129 b->bufsize = blkcnt * blksz; 130 131 tmpbuf = malloc(b->bufsize, M_DEVBUF, M_NOWAIT); |
132 if (tmpbuf == NULL) | 132 if (tmpbuf == NULL) |
133 return ENOMEM; 134 free(b->tmpbuf, M_DEVBUF); 135 b->tmpbuf = tmpbuf; 136 sndbuf_reset(b); 137 return 0; 138} 139 140int --- 439 unchanged lines hidden --- | 133 return ENOMEM; 134 free(b->tmpbuf, M_DEVBUF); 135 b->tmpbuf = tmpbuf; 136 sndbuf_reset(b); 137 return 0; 138} 139 140int --- 439 unchanged lines hidden --- |