From d162ecbaffe845c9707da5d2f6cab11f343ef00e Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Sun, 27 Oct 2019 19:40:52 -0400 Subject: Issue #1267 - Part 1: Update libcubeb to a1200c34. --- media/libcubeb/src/cubeb_audiotrack.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'media/libcubeb/src/cubeb_audiotrack.c') diff --git a/media/libcubeb/src/cubeb_audiotrack.c b/media/libcubeb/src/cubeb_audiotrack.c index fe2603405..22f1fe0bc 100644 --- a/media/libcubeb/src/cubeb_audiotrack.c +++ b/media/libcubeb/src/cubeb_audiotrack.c @@ -13,7 +13,7 @@ #include #include #include -#include "android/log.h" +#include #include "cubeb/cubeb.h" #include "cubeb-internal.h" @@ -75,12 +75,14 @@ struct cubeb { }; struct cubeb_stream { + /* Note: Must match cubeb_stream layout in cubeb.c. */ cubeb * context; + void * user_ptr; + /**/ cubeb_stream_params params; cubeb_data_callback data_callback; cubeb_state_callback state_callback; void * instance; - void * user_ptr; /* Number of frames that have been passed to the AudioTrack callback */ long unsigned written; int draining; @@ -145,9 +147,9 @@ audiotrack_get_min_frame_count(cubeb * ctx, cubeb_stream_params * params, int * status_t status; /* Recent Android have a getMinFrameCount method. */ if (!audiotrack_version_is_gingerbread(ctx)) { - status = ctx->klass.get_min_frame_count(min_frame_count, params->stream_type, params->rate); + status = ctx->klass.get_min_frame_count(min_frame_count, AUDIO_STREAM_TYPE_MUSIC, params->rate); } else { - status = ctx->klass.get_min_frame_count_gingerbread(min_frame_count, params->stream_type, params->rate); + status = ctx->klass.get_min_frame_count_gingerbread(min_frame_count, AUDIO_STREAM_TYPE_MUSIC, params->rate); } if (status != 0) { ALOG("error getting the min frame count"); @@ -325,7 +327,7 @@ audiotrack_stream_init(cubeb * ctx, cubeb_stream ** stream, char const * stream_ channels = stm->params.channels == 2 ? AUDIO_CHANNEL_OUT_STEREO_ICS : AUDIO_CHANNEL_OUT_MONO_ICS; } - ctx->klass.ctor(stm->instance, stm->params.stream_type, stm->params.rate, + ctx->klass.ctor(stm->instance, AUDIO_STREAM_TYPE_MUSIC, stm->params.rate, AUDIO_FORMAT_PCM_16_BIT, channels, min_frame_count, 0, audiotrack_refill, stm, 0, 0); @@ -422,15 +424,16 @@ static struct cubeb_ops const audiotrack_ops = { .get_min_latency = audiotrack_get_min_latency, .get_preferred_sample_rate = audiotrack_get_preferred_sample_rate, .enumerate_devices = NULL, + .device_collection_destroy = NULL, .destroy = audiotrack_destroy, .stream_init = audiotrack_stream_init, .stream_destroy = audiotrack_stream_destroy, .stream_start = audiotrack_stream_start, .stream_stop = audiotrack_stream_stop, + .stream_reset_default_device = NULL, .stream_get_position = audiotrack_stream_get_position, .stream_get_latency = audiotrack_stream_get_latency, .stream_set_volume = audiotrack_stream_set_volume, - .stream_set_panning = NULL, .stream_get_current_device = NULL, .stream_device_destroy = NULL, .stream_register_device_changed_callback = NULL, -- cgit v1.2.3