diff options
author | George Kiagiadakis <george.kiagiadakis@collabora.com> | 2019-07-29 16:12:45 +0300 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2019-07-30 11:11:57 +0200 |
commit | 30576fcff8f2a2a1f77e9234aa6eb06c77c3e495 (patch) | |
tree | d0c9fd2d30d311bd1e98a54dfe16bf938aecc3e7 | |
parent | bf618c34404e88aa48219b48449785061c0a93c2 (diff) |
audioconvert/fmtconvert: assume F32 on the other port when listing formats
This allows picking F32LE as the default format on links that have
no restriction and it avoids failing negotiation when the restricted
end cannot handle S16/F32/F32P
For instance this pipeline would previously fail:
audio-dsp mode=merge ! audio-dsp mode=convert ! alsa-sink
old negotiation: S16LE S24_32LE
new negotiation: F32LE S24_32LE
The link between the audio-dsp nodes has no restriction, so previously
it would negotiate S16LE, which would then fail to negotiate with alsa-sink
because fmtconvert does not know how to convert S16LE to S24_32LE directly.
With this change, the middle link negotiates to F32LE, which can be
converted to anything.
-rw-r--r-- | spa/plugins/audioconvert/fmtconvert.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spa/plugins/audioconvert/fmtconvert.c b/spa/plugins/audioconvert/fmtconvert.c index af39e345..513b7a74 100644 --- a/spa/plugins/audioconvert/fmtconvert.c +++ b/spa/plugins/audioconvert/fmtconvert.c @@ -336,7 +336,7 @@ static int port_enum_formats(void *object, if (other->have_format) info = other->format; else - info.info.raw.format = SPA_AUDIO_FORMAT_S16; + info.info.raw.format = SPA_AUDIO_FORMAT_F32; if (!other->have_format || info.info.raw.format == SPA_AUDIO_FORMAT_F32P || |