]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_sndfile] fix read sndfiles with float data
authorSeven Du <seven@signalwire.com>
Fri, 24 Apr 2020 20:47:45 +0000 (04:47 +0800)
committerAndrey Volk <andywolk@gmail.com>
Tue, 16 Mar 2021 17:22:34 +0000 (20:22 +0300)
src/mod/formats/mod_sndfile/mod_sndfile.c

index 5d2962a8c4d5388da080a7e67c4faec7f081d31b..0977a4950bc4b96383429c174eded3072c68e40a 100644 (file)
@@ -309,6 +309,12 @@ static switch_status_t sndfile_file_open(switch_file_handle_t *handle, const cha
                sf_command(context->handle, SFC_FILE_TRUNCATE, &frames, sizeof(frames));
        }
 
+       /*
+               http://www.mega-nerd.com/libsndfile/api.html#note2
+        */
+       if (switch_test_flag(handle, SWITCH_FILE_DATA_SHORT)) {
+               sf_command(context->handle,  SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE);
+       }
 
   end: