audio/pw: simplify error reporting in stream creation
create_stream() now reports on all error paths. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20230506163735.3481387-11-marcandre.lureau@redhat.com>
This commit is contained in:
parent
0c57a05533
commit
6f1b280e44
@ -486,8 +486,6 @@ static int
|
|||||||
qpw_stream_new(pwaudio *c, PWVoice *v, const char *stream_name,
|
qpw_stream_new(pwaudio *c, PWVoice *v, const char *stream_name,
|
||||||
const char *name, enum spa_direction dir)
|
const char *name, enum spa_direction dir)
|
||||||
{
|
{
|
||||||
int r;
|
|
||||||
|
|
||||||
switch (v->info.channels) {
|
switch (v->info.channels) {
|
||||||
case 8:
|
case 8:
|
||||||
v->info.position[0] = SPA_AUDIO_CHANNEL_FL;
|
v->info.position[0] = SPA_AUDIO_CHANNEL_FL;
|
||||||
@ -540,13 +538,7 @@ qpw_stream_new(pwaudio *c, PWVoice *v, const char *stream_name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* create a new unconnected pwstream */
|
/* create a new unconnected pwstream */
|
||||||
r = create_stream(c, v, stream_name, name, dir);
|
return create_stream(c, v, stream_name, name, dir);
|
||||||
if (r < 0) {
|
|
||||||
AUD_log(AUDIO_CAP, "Failed to create stream.");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -577,7 +569,6 @@ qpw_init_out(HWVoiceOut *hw, struct audsettings *as, void *drv_opaque)
|
|||||||
r = qpw_stream_new(c, v, ppdo->stream_name ? : c->dev->id,
|
r = qpw_stream_new(c, v, ppdo->stream_name ? : c->dev->id,
|
||||||
ppdo->name, SPA_DIRECTION_OUTPUT);
|
ppdo->name, SPA_DIRECTION_OUTPUT);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
error_report("qpw_stream_new for playback failed");
|
|
||||||
pw_thread_loop_unlock(c->thread_loop);
|
pw_thread_loop_unlock(c->thread_loop);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -621,7 +612,6 @@ qpw_init_in(HWVoiceIn *hw, struct audsettings *as, void *drv_opaque)
|
|||||||
r = qpw_stream_new(c, v, ppdo->stream_name ? : c->dev->id,
|
r = qpw_stream_new(c, v, ppdo->stream_name ? : c->dev->id,
|
||||||
ppdo->name, SPA_DIRECTION_INPUT);
|
ppdo->name, SPA_DIRECTION_INPUT);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
error_report("qpw_stream_new for recording failed");
|
|
||||||
pw_thread_loop_unlock(c->thread_loop);
|
pw_thread_loop_unlock(c->thread_loop);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user