diff options
author | Wim Taymans <wtaymans@redhat.com> | 2019-10-24 12:51:34 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2019-10-24 12:51:34 +0200 |
commit | 81fc595e3d7410d22e1d14b96d22d52b424f38f7 (patch) | |
tree | e8f00669ab4ac6077d006c09ac63a521605320ee /spa | |
parent | f30b4bf5062fca18ce5c1230f7ab4fbf970fa63d (diff) |
add defines for max buffer size
Diffstat (limited to 'spa')
-rw-r--r-- | spa/plugins/bluez5/a2dp-sink.c | 4 | ||||
-rw-r--r-- | spa/plugins/bluez5/a2dp-source.c | 4 | ||||
-rw-r--r-- | spa/plugins/bluez5/defs.h | 2 | ||||
-rw-r--r-- | spa/plugins/bluez5/sco-sink.c | 4 | ||||
-rw-r--r-- | spa/plugins/volume/volume.c | 5 |
5 files changed, 11 insertions, 8 deletions
diff --git a/spa/plugins/bluez5/a2dp-sink.c b/spa/plugins/bluez5/a2dp-sink.c index d9febe2d..57017b80 100644 --- a/spa/plugins/bluez5/a2dp-sink.c +++ b/spa/plugins/bluez5/a2dp-sink.c @@ -151,8 +151,8 @@ struct impl { #define CHECK_PORT(this,d,p) ((d) == SPA_DIRECTION_INPUT && (p) == 0) -static const uint32_t default_min_latency = 128; -static const uint32_t default_max_latency = 1024; +static const uint32_t default_min_latency = MIN_LATENCY; +static const uint32_t default_max_latency = MAX_LATENCY; static void reset_props(struct props *props) { diff --git a/spa/plugins/bluez5/a2dp-source.c b/spa/plugins/bluez5/a2dp-source.c index 3ffb70e3..7056aaad 100644 --- a/spa/plugins/bluez5/a2dp-source.c +++ b/spa/plugins/bluez5/a2dp-source.c @@ -127,8 +127,8 @@ struct impl { #define CHECK_PORT(this,d,p) ((d) == SPA_DIRECTION_OUTPUT && (p) == 0) -static const uint32_t default_min_latency = 128; -static const uint32_t default_max_latency = 1024; +static const uint32_t default_min_latency = MIN_LATENCY; +static const uint32_t default_max_latency = MAX_LATENCY; static void reset_props(struct props *props) { diff --git a/spa/plugins/bluez5/defs.h b/spa/plugins/bluez5/defs.h index 6f4e8f4f..75c6a8ae 100644 --- a/spa/plugins/bluez5/defs.h +++ b/spa/plugins/bluez5/defs.h @@ -40,6 +40,8 @@ extern "C" { #define BLUEZ_MEDIA_ENDPOINT_INTERFACE BLUEZ_SERVICE ".MediaEndpoint1" #define BLUEZ_MEDIA_TRANSPORT_INTERFACE BLUEZ_SERVICE ".MediaTransport1" +#define MIN_LATENCY 128 +#define MAX_LATENCY 1024 #define ENDPOINT_INTROSPECT_XML \ DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE \ diff --git a/spa/plugins/bluez5/sco-sink.c b/spa/plugins/bluez5/sco-sink.c index 9583afd2..c02c00b0 100644 --- a/spa/plugins/bluez5/sco-sink.c +++ b/spa/plugins/bluez5/sco-sink.c @@ -134,8 +134,8 @@ struct impl { #define CHECK_PORT(this,d,p) ((d) == SPA_DIRECTION_INPUT && (p) == 0) -static const uint32_t default_min_latency = 128; -static const uint32_t default_max_latency = 1024; +static const uint32_t default_min_latency = MIN_LATENCY; +static const uint32_t default_max_latency = MAX_LATENCY; static void reset_props(struct props *props) { diff --git a/spa/plugins/volume/volume.c b/spa/plugins/volume/volume.c index 0a321f63..335572e7 100644 --- a/spa/plugins/volume/volume.c +++ b/spa/plugins/volume/volume.c @@ -51,6 +51,7 @@ static void reset_props(struct props *props) props->mute = DEFAULT_MUTE; } +#define MAX_SAMPLES 1024 #define MAX_BUFFERS 16 struct buffer { @@ -381,9 +382,9 @@ impl_node_port_enum_params(void *object, int seq, SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(2, 1, MAX_BUFFERS), SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1), SPA_PARAM_BUFFERS_size, SPA_POD_CHOICE_RANGE_Int( - 1024 * this->bpf, + MAX_SAMPLES * this->bpf, 16 * this->bpf, - INT32_MAX / this->bpf), + INT32_MAX), SPA_PARAM_BUFFERS_stride, SPA_POD_Int(0), SPA_PARAM_BUFFERS_align, SPA_POD_Int(16)); break; |