From 86804d71af3566765f6dce93333c7f21fa87d068 Mon Sep 17 00:00:00 2001 From: MarcKe Date: Fri, 27 Feb 2015 08:56:11 +0100 Subject: audio: remove deprecated audio_stream_frame_size Change-Id: I8593343012faf5b528df03cc9ed098bf44b66888 --- audio/audio_hw.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'audio') diff --git a/audio/audio_hw.c b/audio/audio_hw.c index e957458..e3cf20a 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -768,7 +768,7 @@ static int start_output_stream_low_latency(struct m0_stream_out *out) if (success) { out->buffer_frames = pcm_config_tones.period_size * 2; if (out->buffer == NULL) - out->buffer = malloc(out->buffer_frames * audio_stream_frame_size(&out->stream.common)); + out->buffer = malloc(out->buffer_frames * audio_stream_out_frame_size(&out->stream.common)); if (adev->echo_reference != NULL) out->echo_reference = adev->echo_reference; @@ -968,7 +968,7 @@ static size_t out_get_buffer_size_low_latency(const struct audio_stream *stream) from pcm_config_tones.rate. */ size_t size = (SHORT_PERIOD_SIZE * DEFAULT_OUT_SAMPLING_RATE) / pcm_config_tones.rate; size = ((size + 15) / 16) * 16; - return size * audio_stream_frame_size((struct audio_stream *)stream); + return size * audio_stream_out_frame_size((struct audio_stream *)stream); } static size_t out_get_buffer_size_deep_buffer(const struct audio_stream *stream) @@ -982,7 +982,7 @@ static size_t out_get_buffer_size_deep_buffer(const struct audio_stream *stream) size_t size = (DEEP_BUFFER_SHORT_PERIOD_SIZE * DEFAULT_OUT_SAMPLING_RATE) / pcm_config_mm.rate; size = ((size + 15) / 16) * 16; - return size * audio_stream_frame_size((struct audio_stream *)stream); + return size * audio_stream_out_frame_size((struct audio_stream *)stream); } static audio_channel_mask_t out_get_channels(const struct audio_stream *stream) @@ -1206,7 +1206,7 @@ static ssize_t out_write_low_latency(struct audio_stream_out *stream, const void int ret; struct m0_stream_out *out = (struct m0_stream_out *)stream; struct m0_audio_device *adev = out->dev; - size_t frame_size = audio_stream_frame_size(&out->stream.common); + size_t frame_size = audio_stream_out_frame_size(&out->stream.common); size_t in_frames = bytes / frame_size; size_t out_frames = in_frames; bool force_input_standby = false; @@ -1274,7 +1274,7 @@ exit: pthread_mutex_unlock(&out->lock); if (ret != 0) { - usleep(bytes * 1000000 / audio_stream_frame_size(&stream->common) / + usleep(bytes * 1000000 / audio_stream_out_frame_size(&stream->common) / out_get_sample_rate(&stream->common)); } @@ -1298,7 +1298,7 @@ static ssize_t out_write_deep_buffer(struct audio_stream_out *stream, const void int ret; struct m0_stream_out *out = (struct m0_stream_out *)stream; struct m0_audio_device *adev = out->dev; - size_t frame_size = audio_stream_frame_size(&out->stream.common); + size_t frame_size = audio_stream_out_frame_size(&out->stream.common); size_t in_frames = bytes / frame_size; size_t out_frames; bool use_long_periods; @@ -1377,7 +1377,7 @@ exit: pthread_mutex_unlock(&out->lock); if (ret != 0) { - usleep(bytes * 1000000 / audio_stream_frame_size(&stream->common) / + usleep(bytes * 1000000 / audio_stream_out_frame_size(&stream->common) / out_get_sample_rate(&stream->common)); } @@ -1989,7 +1989,7 @@ static ssize_t in_read(struct audio_stream_in *stream, void* buffer, int ret = 0; struct m0_stream_in *in = (struct m0_stream_in *)stream; struct m0_audio_device *adev = in->dev; - size_t frames_rq = bytes / audio_stream_frame_size(&stream->common); + size_t frames_rq = bytes / audio_stream_in_frame_size(&stream->common); /* acquiring hw device mutex systematically is useful if a low priority thread is waiting * on the input stream mutex - e.g. executing select_mode() while holding the hw device @@ -2022,7 +2022,7 @@ static ssize_t in_read(struct audio_stream_in *stream, void* buffer, exit: if (ret < 0) - usleep(bytes * 1000000 / audio_stream_frame_size(&stream->common) / + usleep(bytes * 1000000 / audio_stream_in_frame_size(&stream->common) / in_get_sample_rate(&stream->common)); pthread_mutex_unlock(&in->lock); -- cgit v1.1