mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
small cleanups
This commit is contained in:
parent
d93dd5ec93
commit
1ede97577b
2 changed files with 7 additions and 4 deletions
|
|
@ -133,7 +133,7 @@ fill_item(struct impl *this, snd_ctl_card_info_t *card_info,
|
||||||
{
|
{
|
||||||
const char *str, *name, *klass = NULL;
|
const char *str, *name, *klass = NULL;
|
||||||
const struct spa_handle_factory *factory = NULL;
|
const struct spa_handle_factory *factory = NULL;
|
||||||
char device_name[64], id[64];
|
char device_name[64], id[66];
|
||||||
struct type *t = &this->type;
|
struct type *t = &this->type;
|
||||||
struct udev_device *dev = card->dev;
|
struct udev_device *dev = card->dev;
|
||||||
struct device *device;
|
struct device *device;
|
||||||
|
|
@ -153,13 +153,13 @@ fill_item(struct impl *this, snd_ctl_card_info_t *card_info,
|
||||||
factory = &spa_alsa_sink_factory;
|
factory = &spa_alsa_sink_factory;
|
||||||
klass = "Audio/Sink";
|
klass = "Audio/Sink";
|
||||||
SPA_FLAG_SET(device->flags, DEVICE_FLAG_PLAYBACK);
|
SPA_FLAG_SET(device->flags, DEVICE_FLAG_PLAYBACK);
|
||||||
snprintf(id, 64, "%s/P", device_name);
|
snprintf(id, 66, "%s/P", device_name);
|
||||||
break;
|
break;
|
||||||
case SND_PCM_STREAM_CAPTURE:
|
case SND_PCM_STREAM_CAPTURE:
|
||||||
factory = &spa_alsa_source_factory;
|
factory = &spa_alsa_source_factory;
|
||||||
klass = "Audio/Source";
|
klass = "Audio/Source";
|
||||||
SPA_FLAG_SET(device->flags, DEVICE_FLAG_RECORD);
|
SPA_FLAG_SET(device->flags, DEVICE_FLAG_RECORD);
|
||||||
snprintf(id, 64, "%s/C", device_name);
|
snprintf(id, 66, "%s/C", device_name);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
||||||
|
|
@ -786,6 +786,7 @@ static int impl_node_process(struct spa_node *node)
|
||||||
struct port *outport, *inport;
|
struct port *outport, *inport;
|
||||||
struct spa_io_buffers *outio, *inio;
|
struct spa_io_buffers *outio, *inio;
|
||||||
struct buffer *sbuf, *dbuf;
|
struct buffer *sbuf, *dbuf;
|
||||||
|
int res = 0;
|
||||||
|
|
||||||
spa_return_val_if_fail(node != NULL, -EINVAL);
|
spa_return_val_if_fail(node != NULL, -EINVAL);
|
||||||
|
|
||||||
|
|
@ -851,13 +852,15 @@ static int impl_node_process(struct spa_node *node)
|
||||||
if (inport->offset >= size) {
|
if (inport->offset >= size) {
|
||||||
inio->status = SPA_STATUS_NEED_BUFFER;
|
inio->status = SPA_STATUS_NEED_BUFFER;
|
||||||
inport->offset = 0;
|
inport->offset = 0;
|
||||||
|
res |= SPA_STATUS_NEED_BUFFER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
outio->status = SPA_STATUS_HAVE_BUFFER;
|
outio->status = SPA_STATUS_HAVE_BUFFER;
|
||||||
outio->buffer_id = dbuf->outbuf->id;
|
outio->buffer_id = dbuf->outbuf->id;
|
||||||
|
res |= SPA_STATUS_HAVE_BUFFER;
|
||||||
|
|
||||||
return outio->status;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct spa_node impl_node = {
|
static const struct spa_node impl_node = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue