diff options
| author | Rachad <rachad@google.com> | 2014-08-30 01:11:34 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-30 01:11:36 +0000 |
| commit | 8b63a2bf503f7feca5c24f1cf9bca657dac9eb25 (patch) | |
| tree | 32fd19cc1e84f9f244d3092ed226f9097fa45b5b | |
| parent | f7255fcc149041ac5c7d91a13e63a9a09d70a13f (diff) | |
| parent | c38f9ba81cf8e4493e2d2324be9acf5d5e997b4b (diff) | |
| download | frameworks_base-8b63a2bf503f7feca5c24f1cf9bca657dac9eb25.zip frameworks_base-8b63a2bf503f7feca5c24f1cf9bca657dac9eb25.tar.gz frameworks_base-8b63a2bf503f7feca5c24f1cf9bca657dac9eb25.tar.bz2 | |
Merge "Tunneled Video Playback: Fixed missing AudioHwSync for provided Audio session ID" into lmp-dev
| -rw-r--r-- | media/java/android/media/MediaCodec.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java index 032f07f..3e8ee93 100644 --- a/media/java/android/media/MediaCodec.java +++ b/media/java/android/media/MediaCodec.java @@ -557,12 +557,15 @@ final public class MediaCodec { int i = 0; for (Map.Entry<String, Object> entry: formatMap.entrySet()) { if (entry.getKey().equals(MediaFormat.KEY_AUDIO_SESSION_ID)) { - // TODO: Wire up as soon as AudioService is ready. Check entry.getValue() for - // non-integral type. - // long audioHwSync = audioService.getAudioHwSyncForSession(entry.getValue()); - long audioHwSync = 0; + int sessionId = 0; + try { + sessionId = (Integer)entry.getValue(); + } + catch (Exception e) { + throw new IllegalArgumentException("Wrong Session ID Parameter!"); + } keys[i] = "audio-hw-sync"; - values[i] = audioHwSync; + values[i] = AudioSystem.getAudioHwSyncForSession(sessionId); } else { keys[i] = entry.getKey(); values[i] = entry.getValue(); |
