diff options
author | Glenn Kasten <gkasten@google.com> | 2015-08-07 16:38:45 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-08-07 16:38:45 +0000 |
commit | 569737c6b0301a1411bd02cc9eb59e9c64c8a7eb (patch) | |
tree | 35411998200001a0645c8f701a67cc284eae7afa | |
parent | b3759712b0ab4ae294731ee5889c2ebd131a156f (diff) | |
parent | c9515ce60d45556cb11f49a3e35eb8ddc40548a7 (diff) | |
download | hardware_libhardware-569737c6b0301a1411bd02cc9eb59e9c64c8a7eb.zip hardware_libhardware-569737c6b0301a1411bd02cc9eb59e9c64c8a7eb.tar.gz hardware_libhardware-569737c6b0301a1411bd02cc9eb59e9c64c8a7eb.tar.bz2 |
Merge "Add USB out_get_presentation_position() for timestamps" into mnc-dev
-rw-r--r-- | modules/usbaudio/audio_hal.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/usbaudio/audio_hal.c b/modules/usbaudio/audio_hal.c index bbea5f5..38fea86 100644 --- a/modules/usbaudio/audio_hal.c +++ b/modules/usbaudio/audio_hal.c @@ -442,8 +442,16 @@ static int out_get_render_position(const struct audio_stream_out *stream, uint32 static int out_get_presentation_position(const struct audio_stream_out *stream, uint64_t *frames, struct timespec *timestamp) { - /* FIXME - This needs to be implemented */ - return -EINVAL; + struct stream_out *out = (struct stream_out *)stream; // discard const qualifier + lock_output_stream(out); + + const alsa_device_proxy *proxy = &out->proxy; + const int ret = proxy_get_presentation_position(proxy, frames, timestamp); + + pthread_mutex_unlock(&out->lock); + ALOGV("out_get_presentation_position() status:%d frames:%llu", + ret, (unsigned long long)*frames); + return ret; } static int out_add_audio_effect(const struct audio_stream *stream, effect_handle_t effect) |