sendspin: reject unsupported receive codecs

Commit b1b565339 ("sendspin: negotiate the first raw format") says that
FLAC and Opus are not supported yet. The receiver also only advertises
PCM formats in its player support.

Reject non-PCM stream/start codecs in the receiver. Otherwise
parse_player() accepts FLAC or Opus without setting client->stride,
while the receive path later uses client->stride as a raw frame size.

Signed-off-by: Wang Yu <wangyu@uniontech.com>
This commit is contained in:
Wang Yu 2026-06-02 19:58:51 +08:00 committed by Wim Taymans
parent 1a1cd8d743
commit 8c8bd150ad

View file

@ -753,16 +753,6 @@ static int parse_player(struct client *client, struct spa_json *player)
return -EINVAL; return -EINVAL;
} }
} }
else if (spa_streq(codec, "opus")) {
client->info.media_subtype = SPA_MEDIA_SUBTYPE_opus;
client->info.info.opus.rate = sample_rate;
client->info.info.opus.channels = channels;
}
else if (spa_streq(codec, "flac")) {
client->info.media_subtype = SPA_MEDIA_SUBTYPE_flac;
client->info.info.flac.rate = sample_rate;
client->info.info.flac.channels = channels;
}
else else
return -EINVAL; return -EINVAL;