]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_sndfile] don't force channels and sample rate with .raw extension
authorDragos Oancea <dragos@signalwire.com>
Tue, 29 Oct 2019 17:47:22 +0000 (17:47 +0000)
committerAndrey Volk <andywolk@gmail.com>
Tue, 29 Oct 2019 17:47:22 +0000 (21:47 +0400)
src/mod/formats/mod_sndfile/mod_sndfile.c

index a6f866356f6d7774eb9532c730e2e4ece5701293..b9884c2138bcc542d78748d480c5796b9d95f125 100644 (file)
@@ -117,21 +117,19 @@ static switch_status_t sndfile_file_open(switch_file_handle_t *handle, const cha
                context->sfinfo.format |= map->format;
        }
 
-       if (!strcmp(ext, "r8") || !strcmp(ext, "raw")) {
+       if (!strcmp(ext, "raw")) {
+               context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
+       } else if (!strcmp(ext, "r8")) {
                context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
-               context->sfinfo.channels = 1;
                context->sfinfo.samplerate = 8000;
        } else if (!strcmp(ext, "r16")) {
                context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_16;
-               context->sfinfo.channels = 1;
                context->sfinfo.samplerate = 16000;
        } else if (!strcmp(ext, "r24")) {
                context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_24;
-               context->sfinfo.channels = 1;
                context->sfinfo.samplerate = 24000;
        } else if (!strcmp(ext, "r32")) {
                context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_32;
-               context->sfinfo.channels = 1;
                context->sfinfo.samplerate = 32000;
        } else if (!strcmp(ext, "gsm")) {
                context->sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_GSM610;