Check errors on pipewire stream connect
This commit is contained in:
@@ -131,13 +131,14 @@ struct pipewire_device : public audio_device
|
|||||||
};
|
};
|
||||||
const spa_pod * param = spa_format_audio_raw_build(&b, SPA_PARAM_EnumFormat, &info);
|
const spa_pod * param = spa_format_audio_raw_build(&b, SPA_PARAM_EnumFormat, &info);
|
||||||
|
|
||||||
pw_stream_connect(
|
if (pw_stream_connect(
|
||||||
speaker.get(),
|
speaker.get(),
|
||||||
PW_DIRECTION_INPUT,
|
PW_DIRECTION_INPUT,
|
||||||
PW_ID_ANY,
|
PW_ID_ANY,
|
||||||
pw_stream_flags(PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_MAP_BUFFERS),
|
pw_stream_flags(PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_MAP_BUFFERS),
|
||||||
¶m,
|
¶m,
|
||||||
1);
|
1) < 0)
|
||||||
|
throw std::runtime_error("failed to connect speaker stream");
|
||||||
U_LOG_I("pipewire speaker stream created");
|
U_LOG_I("pipewire speaker stream created");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,13 +179,14 @@ struct pipewire_device : public audio_device
|
|||||||
};
|
};
|
||||||
const spa_pod * param = spa_format_audio_raw_build(&b, SPA_PARAM_EnumFormat, &info);
|
const spa_pod * param = spa_format_audio_raw_build(&b, SPA_PARAM_EnumFormat, &info);
|
||||||
|
|
||||||
pw_stream_connect(
|
if (pw_stream_connect(
|
||||||
microphone.get(),
|
microphone.get(),
|
||||||
PW_DIRECTION_OUTPUT,
|
PW_DIRECTION_OUTPUT,
|
||||||
PW_ID_ANY,
|
PW_ID_ANY,
|
||||||
pw_stream_flags(PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_MAP_BUFFERS),
|
pw_stream_flags(PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_MAP_BUFFERS),
|
||||||
¶m,
|
¶m,
|
||||||
1);
|
1) < 0)
|
||||||
|
throw std::runtime_error("failed to connect microphone stream");
|
||||||
U_LOG_I("pipewire microphone stream created");
|
U_LOG_I("pipewire microphone stream created");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user