mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-10 05:33:54 -04:00
adapter: improve format parsing some more
This commit is contained in:
parent
c5a7f30a68
commit
9fb14be4e3
2 changed files with 10 additions and 10 deletions
|
|
@ -761,12 +761,15 @@ static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,
|
||||||
struct spa_audio_info info;
|
struct spa_audio_info info;
|
||||||
|
|
||||||
spa_zero(info);
|
spa_zero(info);
|
||||||
if (spa_format_audio_parse(format, &info) >= 0) {
|
if ((res = spa_format_audio_parse(format, &info)) < 0)
|
||||||
if (info.media_subtype != SPA_MEDIA_SUBTYPE_raw)
|
return res;
|
||||||
return -ENOTSUP;
|
|
||||||
|
if (info.media_subtype == SPA_MEDIA_SUBTYPE_raw)
|
||||||
info.info.raw.rate = 0;
|
info.info.raw.rate = 0;
|
||||||
this->default_format = info;
|
else
|
||||||
}
|
return -ENOTSUP;
|
||||||
|
|
||||||
|
this->default_format = info;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
|
|
|
||||||
|
|
@ -748,13 +748,10 @@ static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,
|
||||||
if (param == NULL)
|
if (param == NULL)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if ((res = spa_format_parse(param, &info.media_type, &info.media_subtype)) < 0)
|
|
||||||
return res;
|
|
||||||
if (info.media_type != SPA_MEDIA_TYPE_video ||
|
|
||||||
info.media_subtype != SPA_MEDIA_SUBTYPE_raw)
|
|
||||||
return -EINVAL;
|
|
||||||
if (spa_format_video_parse(param, &info) < 0)
|
if (spa_format_video_parse(param, &info) < 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
if (info.media_subtype != SPA_MEDIA_SUBTYPE_raw)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
this->follower_current_format = info;
|
this->follower_current_format = info;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue