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

Commit c38f9ba8 authored by Rachad's avatar Rachad
Browse files

Tunneled Video Playback:

Fixed missing AudioHwSync for provided Audio session ID

Bug: 17112525
Change-Id: I89509ada88462d4db7fc37007e0ffaea153da5cd
parent af410a51
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();