summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2015-08-07 16:38:45 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-08-07 16:38:45 +0000
commit569737c6b0301a1411bd02cc9eb59e9c64c8a7eb (patch)
tree35411998200001a0645c8f701a67cc284eae7afa
parentb3759712b0ab4ae294731ee5889c2ebd131a156f (diff)
parentc9515ce60d45556cb11f49a3e35eb8ddc40548a7 (diff)
downloadhardware_libhardware-569737c6b0301a1411bd02cc9eb59e9c64c8a7eb.tar.gz
hardware_libhardware-569737c6b0301a1411bd02cc9eb59e9c64c8a7eb.tar.bz2
hardware_libhardware-569737c6b0301a1411bd02cc9eb59e9c64c8a7eb.zip
Merge "Add USB out_get_presentation_position() for timestamps" into mnc-dev
-rw-r--r--modules/usbaudio/audio_hal.c12
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)