From c6bd5db9d9cf4bba1649b5b7ddea2d23f5de23a9 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Mon, 9 Mar 2015 16:29:33 -0700 Subject: fix flush on HW A/V sync tracks Fix mismatch between track flags on client and server side when HW A/V sync is requested. The audio track was connected to a direct output by the audio policy manager but the client failed to set the direct flag when creating the track resulting in the direct flag not being set in audio flinger. Bug: 19665934. Change-Id: I0a5257b20bf76c9c4d89bc2ad9b44777b81f13bf --- media/libmedia/AudioTrack.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'media') diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 0ad9cc0..c775e7b 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -299,6 +299,9 @@ status_t AudioTrack::set( ALOGV("Building AudioTrack with attributes: usage=%d content=%d flags=0x%x tags=[%s]", mAttributes.usage, mAttributes.content_type, mAttributes.flags, mAttributes.tags); mStreamType = AUDIO_STREAM_DEFAULT; + if ((mAttributes.flags & AUDIO_FLAG_HW_AV_SYNC) != 0) { + flags = (audio_output_flags_t)(flags | AUDIO_OUTPUT_FLAG_HW_AV_SYNC); + } } // these below should probably come from the audioFlinger too... -- cgit v1.1