package com.strmr.ps.ui.player;

import com.strmr.ps.data.repository.PlayerSettingsRepository;
import defpackage.ak1;
import defpackage.ck1;
import defpackage.e6a;
import defpackage.gr3;
import defpackage.s38;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"Lak1;", "Le6a;", "<anonymous>", "(Lak1;)V"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "com.strmr.ps.ui.player.VideoPlayerActivity$saveSubtitleSettings$1", f = "VideoPlayerActivity.kt", i = {}, l = {6799, 6800, 6801, 6802}, m = "invokeSuspend", n = {}, s = {})
final class aj extends SuspendLambda implements gr3<ak1, Continuation<? super e6a>, Object> {
    public int a;
    public final /* synthetic */ VideoPlayerActivity b;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public aj(VideoPlayerActivity videoPlayerActivity, Continuation continuation) {
        super(2, continuation);
        this.b = videoPlayerActivity;
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation create(Object obj, Continuation continuation) {
        return new aj(this.b, continuation);
    }

    @Override // defpackage.gr3
    public final Object invoke(Object obj, Object obj2) {
        return ((aj) create((ak1) obj, (Continuation) obj2)).invokeSuspend(e6a.a);
    }

    /* JADX WARN: Code restructure failed: missing block: B:24:0x0068, code lost:
    
        if (r8.updateAudioDelay(r3, r7) != r0) goto L26;
     */
    /* JADX WARN: Removed duplicated region for block: B:23:0x005c  */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        PlayerSettingsRepository playerSettingsRepositoryAl;
        long j;
        ck1 ck1Var = ck1.a;
        int i = this.a;
        VideoPlayerActivity videoPlayerActivity = this.b;
        if (i == 0) {
            s38.b(obj);
            PlayerSettingsRepository playerSettingsRepositoryAl2 = videoPlayerActivity.al();
            int i2 = videoPlayerActivity.W;
            this.a = 1;
            if (playerSettingsRepositoryAl2.updateSubtitleSizePercent(i2, this) != ck1Var) {
            }
            return ck1Var;
        }
        if (i == 1) {
            s38.b(obj);
        } else {
            if (i == 2) {
                s38.b(obj);
                playerSettingsRepositoryAl = videoPlayerActivity.al();
                j = videoPlayerActivity.a0;
                this.a = 3;
                if (playerSettingsRepositoryAl.updateSubtitleDelay(j, this) != ck1Var) {
                    PlayerSettingsRepository playerSettingsRepositoryAl3 = videoPlayerActivity.al();
                    long j2 = videoPlayerActivity.b0;
                    this.a = 4;
                }
                return ck1Var;
            }
            if (i != 3) {
                if (i != 4) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                s38.b(obj);
                return e6a.a;
            }
            s38.b(obj);
            PlayerSettingsRepository playerSettingsRepositoryAl32 = videoPlayerActivity.al();
            long j22 = videoPlayerActivity.b0;
            this.a = 4;
        }
        PlayerSettingsRepository playerSettingsRepositoryAl4 = videoPlayerActivity.al();
        int i3 = videoPlayerActivity.X;
        this.a = 2;
        if (playerSettingsRepositoryAl4.updateSubtitleOffsetPercent(i3, this) != ck1Var) {
            playerSettingsRepositoryAl = videoPlayerActivity.al();
            j = videoPlayerActivity.a0;
            this.a = 3;
            if (playerSettingsRepositoryAl.updateSubtitleDelay(j, this) != ck1Var) {
            }
        }
        return ck1Var;
    }
}
