nxlooper: set default format for nxlooper
set default format as AUDIO_FMT_PCM for nxlooper. Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
This commit is contained in:
parent
0acd68b391
commit
ceba53402e
@ -196,7 +196,7 @@ static const int g_nxlooper_cmd_count = sizeof(g_nxlooper_cmds) /
|
|||||||
static int nxlooper_cmd_loopback(FAR struct nxlooper_s *plooper, char *parg)
|
static int nxlooper_cmd_loopback(FAR struct nxlooper_s *plooper, char *parg)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
int format = AUDIO_FMT_PCM;
|
int format = AUDIO_FMT_UNDEF;
|
||||||
int channels = 0;
|
int channels = 0;
|
||||||
int bpsamp = 0;
|
int bpsamp = 0;
|
||||||
int samprate = 0;
|
int samprate = 0;
|
||||||
@ -205,6 +205,11 @@ static int nxlooper_cmd_loopback(FAR struct nxlooper_s *plooper, char *parg)
|
|||||||
sscanf(parg, "%d %d %d %d %d", &channels, &bpsamp,
|
sscanf(parg, "%d %d %d %d %d", &channels, &bpsamp,
|
||||||
&samprate, &chmap, &format);
|
&samprate, &chmap, &format);
|
||||||
|
|
||||||
|
if (format == AUDIO_FMT_UNDEF)
|
||||||
|
{
|
||||||
|
format = AUDIO_FMT_PCM;
|
||||||
|
}
|
||||||
|
|
||||||
/* Try to loopback raw data with settings specified */
|
/* Try to loopback raw data with settings specified */
|
||||||
|
|
||||||
ret = nxlooper_loopback(plooper, format, channels, bpsamp,
|
ret = nxlooper_loopback(plooper, format, channels, bpsamp,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user