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

Commit 3b02fe19 authored by Andreas Huber's avatar Andreas Huber Committed by Android (Google) Code Review
Browse files

Merge "Fix invocation of notification callback in case the callback is modified"

parents 88a8364c 329eec53
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ final public class MediaCodec {
    public static final int BUFFER_FLAG_END_OF_STREAM         = 4;

    private EventHandler mEventHandler;
    private NotificationCallback mNotificationCallback;
    private volatile NotificationCallback mNotificationCallback;

    static final int EVENT_NOTIFY = 1;

@@ -194,8 +194,9 @@ final public class MediaCodec {
            switch (msg.what) {
                case EVENT_NOTIFY:
                {
                    if (mNotificationCallback != null) {
                        mNotificationCallback.onCodecNotify(mCodec);
                    NotificationCallback cb = mNotificationCallback;
                    if (cb != null) {
                        cb.onCodecNotify(mCodec);
                    }
                    break;
                }