summaryrefslogtreecommitdiffstats
path: root/polyp
diff options
context:
space:
mode:
Diffstat (limited to 'polyp')
-rw-r--r--polyp/Makefile.am2
-rw-r--r--polyp/module-oss-mmap.c9
-rw-r--r--polyp/module-oss.c8
3 files changed, 11 insertions, 8 deletions
diff --git a/polyp/Makefile.am b/polyp/Makefile.am
index 39215497..b5acb3fc 100644
--- a/polyp/Makefile.am
+++ b/polyp/Makefile.am
@@ -21,7 +21,7 @@ polypincludedir=$(includedir)/polyp
polypconfdir=$(sysconfdir)/polyp
AM_CFLAGS=-D_GNU_SOURCE -I$(top_srcdir) $(PTHREAD_CFLAGS)
-#AM_CFLAGS+= -DDLSEARCHDIR=\"$(pkglibdir)\"
+AM_CFLAGS+= -DDLSEARCHDIR=\"$(pkglibdir)\"
AM_CFLAGS+="-DDEFAULT_CONFIG_FILE=\"$(polypconfdir)/polypaudio.pa\""
AM_CFLAGS+="-DPOLYPAUDIO_BINARY=\"$(bindir)/polypaudio\""
diff --git a/polyp/module-oss-mmap.c b/polyp/module-oss-mmap.c
index 8151a13a..953871d1 100644
--- a/polyp/module-oss-mmap.c
+++ b/polyp/module-oss-mmap.c
@@ -249,7 +249,7 @@ int pa_module_init(struct pa_core *c, struct pa_module*m) {
nfrags = 12;
frag_size = 1024;
- if (pa_modargs_get_value_s32(ma, "fragments", &nfrags) < 0 || nfrags < 2 || pa_modargs_get_value_s32(ma, "fragment_size", &frag_size) < 0 || frag_size < 1) {
+ if (pa_modargs_get_value_s32(ma, "fragments", &nfrags) < 0 || pa_modargs_get_value_s32(ma, "fragment_size", &frag_size) < 0) {
pa_log(__FILE__": failed to parse fragments arguments\n");
goto fail;
}
@@ -269,9 +269,10 @@ int pa_module_init(struct pa_core *c, struct pa_module*m) {
}
pa_log(__FILE__": device opened in %s mode.\n", mode == O_WRONLY ? "O_WRONLY" : (mode == O_RDONLY ? "O_RDONLY" : "O_RDWR"));
-
- if (pa_oss_set_fragments(u->fd, nfrags, frag_size) < 0)
- goto fail;
+
+ if (nfrags >= 2 && frag_size >= 1)
+ if (pa_oss_set_fragments(u->fd, nfrags, frag_size) < 0)
+ goto fail;
if (pa_oss_auto_format(u->fd, &u->sample_spec) < 0)
goto fail;
diff --git a/polyp/module-oss.c b/polyp/module-oss.c
index 53f1f994..95deca9c 100644
--- a/polyp/module-oss.c
+++ b/polyp/module-oss.c
@@ -202,7 +202,7 @@ int pa_module_init(struct pa_core *c, struct pa_module*m) {
nfrags = 12;
frag_size = 1024;
- if (pa_modargs_get_value_s32(ma, "fragments", &nfrags) < 0 || nfrags < 2 || pa_modargs_get_value_s32(ma, "fragment_size", &frag_size) < 0 || frag_size < 1) {
+ if (pa_modargs_get_value_s32(ma, "fragments", &nfrags) < 0 || pa_modargs_get_value_s32(ma, "fragment_size", &frag_size) < 0) {
pa_log(__FILE__": failed to parse fragments arguments\n");
goto fail;
}
@@ -218,8 +218,10 @@ int pa_module_init(struct pa_core *c, struct pa_module*m) {
pa_log(__FILE__": device opened in %s mode.\n", mode == O_WRONLY ? "O_WRONLY" : (mode == O_RDONLY ? "O_RDONLY" : "O_RDWR"));
- if (pa_oss_set_fragments(fd, nfrags, frag_size) < 0)
- goto fail;
+
+ if (nfrags >= 2 && frag_size >= 1)
+ if (pa_oss_set_fragments(fd, nfrags, frag_size) < 0)
+ goto fail;
if (pa_oss_auto_format(fd, &ss) < 0)
goto fail;