Deleted Added
full compact
feeder.c (109623) feeder.c (110287)
1/*
2 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
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

--- 14 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
1/*
2 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
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

--- 14 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/feeder.c 109623 2003-01-21 08:56:16Z alfred $");
31SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pcm/feeder.c 110287 2003-02-03 15:02:28Z orion $");
32
33MALLOC_DEFINE(M_FEEDER, "feeder", "pcm feeder");
34
35#define MAXFEEDERS 256
36#undef FEEDER_DEBUG
37
38struct feedertab_entry {
39 SLIST_ENTRY(feedertab_entry) link;

--- 343 unchanged lines hidden (view full) ---

383
384 KASSERT(count > 0, ("feed_root: count == 0"));
385 /* count &= ~((1 << ch->align) - 1); */
386 KASSERT(count > 0, ("feed_root: aligned count == 0 (align = %d)", ch->align));
387
388 l = min(count, sndbuf_getready(src));
389 sndbuf_dispose(src, buffer, l);
390
32
33MALLOC_DEFINE(M_FEEDER, "feeder", "pcm feeder");
34
35#define MAXFEEDERS 256
36#undef FEEDER_DEBUG
37
38struct feedertab_entry {
39 SLIST_ENTRY(feedertab_entry) link;

--- 343 unchanged lines hidden (view full) ---

383
384 KASSERT(count > 0, ("feed_root: count == 0"));
385 /* count &= ~((1 << ch->align) - 1); */
386 KASSERT(count > 0, ("feed_root: aligned count == 0 (align = %d)", ch->align));
387
388 l = min(count, sndbuf_getready(src));
389 sndbuf_dispose(src, buffer, l);
390
391 /* When recording only return as much data as available */
392 if (ch->direction == PCMDIR_REC)
393 return l;
394
391/*
392 if (l < count)
393 printf("appending %d bytes\n", count - l);
394*/
395
396 x = (sndbuf_getfmt(src) & AFMT_SIGNED)? 0 : 0x80;
397 while (l < count)
398 buffer[l++] = x;

--- 23 unchanged lines hidden ---
395/*
396 if (l < count)
397 printf("appending %d bytes\n", count - l);
398*/
399
400 x = (sndbuf_getfmt(src) & AFMT_SIGNED)? 0 : 0x80;
401 while (l < count)
402 buffer[l++] = x;

--- 23 unchanged lines hidden ---