[polypaudio-commits] r557 - /trunk/src/modules/module-oss-mmap.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Tue Feb 21 15:56:47 PST 2006
Author: lennart
Date: Wed Feb 22 00:56:46 2006
New Revision: 557
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=557&root=polypaudio&view=rev
Log:
add hw info to description for oss-mmap, too
Modified:
trunk/src/modules/module-oss-mmap.c
Modified: trunk/src/modules/module-oss-mmap.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-oss-mmap.c?rev=557&root=polypaudio&r1=556&r2=557&view=diff
==============================================================================
--- trunk/src/modules/module-oss-mmap.c (original)
+++ trunk/src/modules/module-oss-mmap.c Wed Feb 22 00:56:46 2006
@@ -254,7 +254,10 @@
int enable_bits = 0, zero = 0;
int playback = 1, record = 1;
pa_modargs *ma = NULL;
- assert(c && m);
+ char hwdesc[64];
+
+ assert(c);
+ assert(m);
m->userdata = u = pa_xmalloc0(sizeof(struct userdata));
u->module = m;
@@ -293,6 +296,11 @@
if ((u->fd = pa_oss_open(p = pa_modargs_get_value(ma, "device", DEFAULT_DEVICE), &mode, &caps)) < 0)
goto fail;
+
+ if (pa_oss_get_hw_description(p, hwdesc, sizeof(hwdesc)) >= 0)
+ pa_log_info(__FILE__": hardware name is '%s'.\n", hwdesc);
+ else
+ hwdesc[0] = 0;
if (!(caps & DSP_CAP_MMAP) || !(caps & DSP_CAP_REALTIME) || !(caps & DSP_CAP_TRIGGER)) {
pa_log(__FILE__": OSS device not mmap capable.\n");
@@ -331,7 +339,11 @@
assert(u->source);
u->source->userdata = u;
pa_source_set_owner(u->source, m);
- u->source->description = pa_sprintf_malloc("Open Sound System PCM/mmap() on '%s'", p);
+ u->source->description = pa_sprintf_malloc("Open Sound System PCM/mmap() on '%s'%s%s%s",
+ p,
+ hwdesc[0] ? " (" : "",
+ hwdesc[0] ? hwdesc : "",
+ hwdesc[0] ? ")" : "");
u->in_memblocks = pa_xmalloc0(sizeof(pa_memblock *)*u->in_fragments);
@@ -366,7 +378,11 @@
u->sink->set_hw_volume = sink_set_hw_volume;
u->sink->userdata = u;
pa_sink_set_owner(u->sink, m);
- u->sink->description = pa_sprintf_malloc("Open Sound System PCM/mmap() on '%s'", p);
+ u->sink->description = pa_sprintf_malloc("Open Sound System PCM/mmap() on '%s'%s%s%s",
+ p,
+ hwdesc[0] ? " (" : "",
+ hwdesc[0] ? hwdesc : "",
+ hwdesc[0] ? ")" : "");
u->out_memblocks = pa_xmalloc0(sizeof(struct memblock *)*u->out_fragments);
More information about the pulseaudio-commits
mailing list