Small fixes for error handling

This commit is contained in:
Wim Taymans 2017-10-26 15:13:33 +02:00
parent 08aa175a20
commit 0662f3a3ea
7 changed files with 27 additions and 14 deletions

View file

@ -245,6 +245,7 @@ impl_node_port_set_format(struct spa_node *node,
const struct spa_format *format)
{
struct state *this;
int err;
spa_return_val_if_fail(node != NULL, SPA_RESULT_INVALID_ARGUMENTS);
@ -270,8 +271,8 @@ impl_node_port_set_format(struct spa_node *node,
if (spa_format_audio_raw_parse(format, &info.info.raw, &this->type.format_audio) < 0)
return SPA_RESULT_INVALID_MEDIA_TYPE;
if (spa_alsa_set_format(this, &info, flags) < 0)
return SPA_RESULT_ERROR;
if ((err = spa_alsa_set_format(this, &info, flags)) < 0)
return err;
this->current_format = info;
this->have_format = true;