summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2015-08-07 16:53:34 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-07 16:53:34 +0000
commitaaf2d266f14adffdc6d77f2eb1bd30c43999b923 (patch)
treeab07fae54c8990c922343f9db2e7d8d2ea63c223
parenta7897020c32ec32a14bdcc397230e5ccd4028939 (diff)
parent569737c6b0301a1411bd02cc9eb59e9c64c8a7eb (diff)
downloadhardware_libhardware-aaf2d266f14adffdc6d77f2eb1bd30c43999b923.zip
hardware_libhardware-aaf2d266f14adffdc6d77f2eb1bd30c43999b923.tar.gz
hardware_libhardware-aaf2d266f14adffdc6d77f2eb1bd30c43999b923.tar.bz2
am 569737c6: Merge "Add USB out_get_presentation_position() for timestamps" into mnc-dev
* commit '569737c6b0301a1411bd02cc9eb59e9c64c8a7eb': Add USB out_get_presentation_position() for timestamps
-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)