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

Commit 6e3d3605 authored by Houxiang Dai's avatar Houxiang Dai Committed by Henry Fang
Browse files

support changing audio-hw-sync-id during playback.

Bug: 151997287
Bug: 183968006
Test: Manual
Change-Id: I3ca8a1efbf8a1942fd54e2f892bc76fee847da4c
parent 2a5efce2
Loading
Loading
Loading
Loading
+18 −7
Original line number Diff line number Diff line
@@ -4412,6 +4412,16 @@ final public class MediaCodec {

        int i = 0;
        for (final String key: params.keySet()) {
            if (key.equals(MediaFormat.KEY_AUDIO_SESSION_ID)) {
                int sessionId = 0;
                try {
                    sessionId = (Integer)params.get(key);
                } catch (Exception e) {
                    throw new IllegalArgumentException("Wrong Session ID Parameter!");
                }
                keys[i] = "audio-hw-sync";
                values[i] = AudioSystem.getAudioHwSyncForSession(sessionId);
            } else {
                keys[i] = key;
                Object value = params.get(key);

@@ -4421,6 +4431,7 @@ final public class MediaCodec {
                } else {
                    values[i] = value;
                }
            }
            ++i;
        }