Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b63a2bf authored by Rachad's avatar Rachad Committed by Android (Google) Code Review
Browse files

Merge "Tunneled Video Playback: Fixed missing AudioHwSync for provided Audio...

Merge "Tunneled Video Playback: Fixed missing AudioHwSync for provided Audio session ID" into lmp-dev
parents f7255fcc c38f9ba8
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -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();