stream: only set portconfig on audio formats

This commit is contained in:
Wim Taymans 2019-12-17 17:35:46 +01:00
parent e9b62c0ce6
commit cc0be0d606

View file

@ -136,6 +136,11 @@ static int stream_set_active(struct stream *stream, bool active)
if (active) {
stream->format = node->format;
switch (stream->format.media_type) {
case SPA_MEDIA_TYPE_audio:
switch (stream->format.media_subtype) {
case SPA_MEDIA_SUBTYPE_raw:
stream->format.info.raw.rate = 48000;
spa_pod_builder_init(&b, buf, sizeof(buf));
@ -152,6 +157,13 @@ static int stream_set_active(struct stream *stream, bool active)
pw_node_set_param((struct pw_node*)node->obj->obj.proxy,
SPA_PARAM_PortConfig, 0, param);
break;
default:
break;
}
default:
break;
}
}
stream->active = active;
return 0;