format_wav: Read 16khz wav samples properly
authorSean Bright <sean.bright@gmail.com>
Fri, 14 Apr 2017 18:52:59 +0000 (14:52 -0400)
committerSean Bright <sean.bright@gmail.com>
Mon, 17 Apr 2017 19:51:11 +0000 (14:51 -0500)
commit6c0ab9afa775d30fcc498072eee7f660202fa51e
treef3e5fd04227e3d24f6f71ae9b6176791136fb663
parent2e6075c51fe0466d7410b02efb68f1d47aedb284
format_wav: Read 16khz wav samples properly

When opening a PCM wave file for reading, we aren't tracking the
frequency of the opened file, so we treat 16khz files as 8khz and do
half reads.

This patch also cleans up some of the data types and an unnecessarily
complex `if` expression.

ASTERISK-26613 #close
Reported by: Vitaly K

Change-Id: I05f8b263058dc573ea8ffe0c62e7964506e11815
formats/format_wav.c