From: Vincent Becker Date: Tue, 8 Feb 2011 10:24:08 +0000 (+0100) Subject: Correct wav file creation for 24/32 and 24 bits sample formats HSD=3669357 X-Git-Tag: submit/2.0-panda/20130828.192557~840 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bada9040dddcf666773d32177949635c02f4f51f;p=profile%2Fivi%2Fpulseaudio-panda.git Correct wav file creation for 24/32 and 24 bits sample formats HSD=3669357 --- diff --git a/src/pulsecore/sndfile-util.c b/src/pulsecore/sndfile-util.c index 9d15a86..cadda93 100644 --- a/src/pulsecore/sndfile-util.c +++ b/src/pulsecore/sndfile-util.c @@ -51,6 +51,9 @@ int pa_sndfile_read_sample_spec(SNDFILE *sf, pa_sample_spec *ss) { break; case SF_FORMAT_PCM_24: + ss->format = PA_SAMPLE_S24NE; + break; + case SF_FORMAT_PCM_32: ss->format = PA_SAMPLE_S32NE; break; @@ -106,10 +109,14 @@ int pa_sndfile_write_sample_spec(SF_INFO *sfi, pa_sample_spec *ss) { case PA_SAMPLE_S24LE: case PA_SAMPLE_S24BE: + ss->format = PA_SAMPLE_S24NE; + sfi->format |= SF_FORMAT_PCM_24; + break; + case PA_SAMPLE_S24_32LE: case PA_SAMPLE_S24_32BE: - ss->format = PA_SAMPLE_S32NE; - sfi->format |= SF_FORMAT_PCM_24; + ss->format = PA_SAMPLE_S24_32NE; + sfi->format |= SF_FORMAT_PCM_32; break; case PA_SAMPLE_S32LE: @@ -362,6 +369,7 @@ pa_sndfile_readf_t pa_sndfile_readf_function(const pa_sample_spec *ss) { return (pa_sndfile_readf_t) sf_readf_short; case PA_SAMPLE_S32NE: + case PA_SAMPLE_S24_32NE: return (pa_sndfile_readf_t) sf_readf_int; case PA_SAMPLE_FLOAT32NE: @@ -384,6 +392,7 @@ pa_sndfile_writef_t pa_sndfile_writef_function(const pa_sample_spec *ss) { return (pa_sndfile_writef_t) sf_writef_short; case PA_SAMPLE_S32NE: + case PA_SAMPLE_S24_32NE: return (pa_sndfile_writef_t) sf_writef_int; case PA_SAMPLE_FLOAT32NE: