format: make helper function to parse media type

This commit is contained in:
Wim Taymans 2018-08-29 14:50:58 +02:00
parent 5976beb149
commit 80de83f38a
24 changed files with 127 additions and 100 deletions

View file

@ -1066,9 +1066,7 @@ static int port_set_format(struct spa_node *node,
} else {
struct spa_audio_info info = { 0 };
if ((err = spa_pod_object_parse(format,
"I", &info.media_type,
"I", &info.media_subtype)) < 0)
if ((err = spa_format_parse(format, &info.media_type, &info.media_subtype)) < 0)
return err;
if (info.media_type != SPA_MEDIA_TYPE_audio ||