From bc6f9a751ab40dc066abf452886e3c949489e2d0 Mon Sep 17 00:00:00 2001 From: Seungbae Shin Date: Thu, 26 Apr 2018 21:47:55 +0900 Subject: [PATCH] Fix float->int(short) clipping issue when playing ogg content related reference: http://www.mega-nerd.com/libsndfile/api.html#note2 https://github.com/erikd/libsndfile/issues/194 [Version] 0.12.15 [Issue Type] Bug Fix Change-Id: I60894d8286c53999c5d907c486a10ca7a88dd95a --- packaging/libmm-sound.spec | 2 +- server/plugin/wav/mm_sound_plugin_codec_wave.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packaging/libmm-sound.spec b/packaging/libmm-sound.spec index 0ba131b..e583ac5 100644 --- a/packaging/libmm-sound.spec +++ b/packaging/libmm-sound.spec @@ -1,6 +1,6 @@ Name: libmm-sound Summary: MMSound Package contains client lib and sound_server binary -Version: 0.12.14 +Version: 0.12.15 Release: 0 Group: System/Libraries License: Apache-2.0 diff --git a/server/plugin/wav/mm_sound_plugin_codec_wave.c b/server/plugin/wav/mm_sound_plugin_codec_wave.c index e97f89a..563f3b1 100644 --- a/server/plugin/wav/mm_sound_plugin_codec_wave.c +++ b/server/plugin/wav/mm_sound_plugin_codec_wave.c @@ -64,6 +64,8 @@ static int _sound_prepare(wave_info_t *h) return (sf_error(h->sf) == SF_ERR_SYSTEM) ? MM_ERROR_SOUND_INTERNAL : MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE; } + sf_command(h->sf, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE); + h->spec.rate = h->si.samplerate; h->spec.channels = h->si.channels; h->spec.format = PA_SAMPLE_S16LE; -- 2.7.4