mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
spa: libcamera: source: port_set_format(): remove goto
Remove the `done` label by moving things into the `format != nullptr` branch.
(cherry picked from commit 47ee86938b)
This commit is contained in:
parent
d76fee1353
commit
ef09f436b3
1 changed files with 16 additions and 17 deletions
|
|
@ -1812,9 +1812,6 @@ next:
|
||||||
int port_set_format(struct impl *impl, struct port *port,
|
int port_set_format(struct impl *impl, struct port *port,
|
||||||
uint32_t flags, const struct spa_pod *format)
|
uint32_t flags, const struct spa_pod *format)
|
||||||
{
|
{
|
||||||
struct spa_video_info info;
|
|
||||||
int res;
|
|
||||||
|
|
||||||
if (format == nullptr) {
|
if (format == nullptr) {
|
||||||
if (!port->current_format)
|
if (!port->current_format)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -1824,9 +1821,12 @@ int port_set_format(struct impl *impl, struct port *port,
|
||||||
port->current_format.reset();
|
port->current_format.reset();
|
||||||
|
|
||||||
spa_libcamera_close(impl);
|
spa_libcamera_close(impl);
|
||||||
goto done;
|
|
||||||
} else {
|
} else {
|
||||||
|
spa_video_info info;
|
||||||
|
int res;
|
||||||
|
|
||||||
spa_zero(info);
|
spa_zero(info);
|
||||||
|
|
||||||
if ((res = spa_format_parse(format, &info.media_type, &info.media_subtype)) < 0)
|
if ((res = spa_format_parse(format, &info.media_type, &info.media_subtype)) < 0)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
|
|
@ -1875,7 +1875,6 @@ int port_set_format(struct impl *impl, struct port *port,
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (port->current_format && !(flags & SPA_NODE_PARAM_FLAG_TEST_ONLY)) {
|
if (port->current_format && !(flags & SPA_NODE_PARAM_FLAG_TEST_ONLY)) {
|
||||||
spa_libcamera_use_buffers(impl, port, nullptr, 0);
|
spa_libcamera_use_buffers(impl, port, nullptr, 0);
|
||||||
|
|
@ -1888,8 +1887,8 @@ int port_set_format(struct impl *impl, struct port *port,
|
||||||
if (!(flags & SPA_NODE_PARAM_FLAG_TEST_ONLY)) {
|
if (!(flags & SPA_NODE_PARAM_FLAG_TEST_ONLY)) {
|
||||||
port->current_format = info;
|
port->current_format = info;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
done:
|
|
||||||
impl->info.change_mask |= SPA_NODE_CHANGE_MASK_PARAMS;
|
impl->info.change_mask |= SPA_NODE_CHANGE_MASK_PARAMS;
|
||||||
port->info.change_mask |= SPA_PORT_CHANGE_MASK_PARAMS;
|
port->info.change_mask |= SPA_PORT_CHANGE_MASK_PARAMS;
|
||||||
if (port->current_format) {
|
if (port->current_format) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue