package p000.p001.p002.p003.p004;

import android.widget.TextView;
import androidx.constraintlayout.widget.Group;
import ar.tvplayer.core.data.db.entities.ހ;
import ar.tvplayer.core.data.repositories.֏;
import ar.tvplayer.core.domain2.ކ;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.upstream.HttpDataSource;
import java.io.IOException;
import p000.p001.p002.p003.C0661;
import p000.p001.p002.p003.C0663;
import p000.p001.p002.p003.p004.C0636;
import p000.p001.p021.p023.C1262;
import p025.p026.InterfaceC1327;
import p138.p139.p143.p144.C2803;
import p138.p176.p177.p242.p246.p251.C4303;
import p402.C6549;
import p402.p405.InterfaceC6575;
import p402.p405.p406.EnumC6586;
import p402.p405.p407.p408.AbstractC6597;
import p402.p405.p407.p408.InterfaceC6593;
import p402.p411.p412.InterfaceC6618;
import p402.p411.p413.C6635;
import p495.p496.C7399;

/* JADX INFO: renamed from: ނ.֏.֏.֏.֏.ࢬ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
@InterfaceC6593(c = "ar.tvplayer.tv.player.ui.PlayerFragment$processError$1", f = "PlayerFragment.kt", l = {1033}, m = "invokeSuspend")
public final class C0615 extends AbstractC6597 implements InterfaceC6618<InterfaceC1327, InterfaceC6575<? super C6549>, Object> {

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public InterfaceC1327 f2914;

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public Object f2915;

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public int f2916;

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public final /* synthetic */ SharedPreferencesOnSharedPreferenceChangeListenerC0501 f2917;

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public final /* synthetic */ ExoPlaybackException f2918;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C0615(SharedPreferencesOnSharedPreferenceChangeListenerC0501 sharedPreferencesOnSharedPreferenceChangeListenerC0501, ExoPlaybackException exoPlaybackException, InterfaceC6575 interfaceC6575) {
        super(2, interfaceC6575);
        this.f2917 = sharedPreferencesOnSharedPreferenceChangeListenerC0501;
        this.f2918 = exoPlaybackException;
    }

    @Override // p402.p405.p407.p408.AbstractC6589
    /* JADX INFO: renamed from: ֏ */
    public final InterfaceC6575<C6549> mo837(Object obj, InterfaceC6575<?> interfaceC6575) {
        if (interfaceC6575 == null) {
            C6635.m9824("completion");
            throw null;
        }
        C0615 c0615 = new C0615(this.f2917, this.f2918, interfaceC6575);
        c0615.f2914 = (InterfaceC1327) obj;
        return c0615;
    }

    @Override // p402.p411.p412.InterfaceC6618
    /* JADX INFO: renamed from: ؠ */
    public final Object mo838(InterfaceC1327 interfaceC1327, InterfaceC6575<? super C6549> interfaceC6575) {
        return ((C0615) mo837(interfaceC1327, interfaceC6575)).mo839(C6549.f19328);
    }

    /* JADX WARN: Removed duplicated region for block: B:31:0x0078  */
    /* JADX WARN: Removed duplicated region for block: B:35:0x0081  */
    /* JADX WARN: Removed duplicated region for block: B:38:0x0086  */
    /* JADX WARN: Removed duplicated region for block: B:39:0x00a1  */
    @Override // p402.p405.p407.p408.AbstractC6589
    /* JADX INFO: renamed from: ށ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object mo839(Object obj) {
        String str;
        String str2;
        ހ r5;
        EnumC6586 enumC6586 = EnumC6586.COROUTINE_SUSPENDED;
        int i = this.f2916;
        if (i == 0) {
            C4303.m7198(obj);
            InterfaceC1327 interfaceC1327 = this.f2914;
            if (!this.f2917.m1801() || (!ކ.֏(this.f2918, 403) && !ކ.֏(this.f2918, 404))) {
                str = "";
                str2 = str;
                if (str2 == null || str2.length() == 0) {
                    C7399.m11004("PlayerFragment").mo11007("Unhandled error, show error screen", new Object[0]);
                    SharedPreferencesOnSharedPreferenceChangeListenerC0501 sharedPreferencesOnSharedPreferenceChangeListenerC0501 = this.f2917;
                    sharedPreferencesOnSharedPreferenceChangeListenerC0501.f2589 = 0;
                    Group group = (Group) sharedPreferencesOnSharedPreferenceChangeListenerC0501.m1744(C0661.groupError);
                    C6635.m9823((Object) group, "groupError");
                    group.setVisibility(0);
                    String string = this.f2917.getString(C0663.player_error_occurred);
                    C6635.m9823((Object) string, "getString(R.string.player_error_occurred)");
                    ExoPlaybackException exoPlaybackException = this.f2918;
                    int i2 = exoPlaybackException.f1531;
                    if (i2 == 0) {
                        IOException iOExceptionM1055 = exoPlaybackException.m1055();
                        HttpDataSource.InvalidResponseCodeException invalidResponseCodeException = (HttpDataSource.InvalidResponseCodeException) (iOExceptionM1055 instanceof HttpDataSource.InvalidResponseCodeException ? iOExceptionM1055 : null);
                        if (invalidResponseCodeException != null) {
                            StringBuilder sbM4897 = C2803.m4897(string, ": ");
                            sbM4897.append(this.f2917.getString(C0663.player_code, new Integer(invalidResponseCodeException.f1975)));
                            string = sbM4897.toString();
                        } else {
                            StringBuilder sbM48972 = C2803.m4897(string, ": ");
                            sbM48972.append(this.f2918.m1055().getClass().getSimpleName());
                            string = sbM48972.toString();
                        }
                    } else if (i2 == 1) {
                        StringBuilder sbM48973 = C2803.m4897(string, ": ");
                        sbM48973.append(this.f2918.m1054().getClass().getSimpleName());
                        string = sbM48973.toString();
                    } else if (i2 == 2) {
                        StringBuilder sbM48974 = C2803.m4897(string, ": ");
                        sbM48974.append(this.f2918.m1056().getClass().getSimpleName());
                        string = sbM48974.toString();
                    } else if (i2 == 3) {
                        StringBuilder sbM48975 = C2803.m4897(string, ": ");
                        sbM48975.append(this.f2918.getMessage());
                        string = sbM48975.toString();
                    } else if (i2 == 4) {
                        string = C2803.m4879(string, ": OutOfMemoryError");
                    }
                    TextView textView = (TextView) this.f2917.m1744(C0661.tvError);
                    C6635.m9823((Object) textView, "tvError");
                    textView.setText(string);
                    this.f2917.m1791();
                } else {
                    C7399.m11004("PlayerFragment").mo11007(C2803.m4879("Restart player for catchup, fallbackCatchupUrl = ", str2), new Object[0]);
                    SharedPreferencesOnSharedPreferenceChangeListenerC0501.m1685(this.f2917, str2, false, false, false, 14);
                }
                return C6549.f19328;
            }
            C0636.C0640 c0640M339 = this.f2917.m1798().f2996.m339();
            if (c0640M339 == null || (r5 = c0640M339.f3013) == null) {
                str2 = null;
                if (str2 == null || str2.length() == 0) {
                }
                return C6549.f19328;
            }
            ֏ r4 = ֏.ؠ;
            C1262 c1262 = this.f2917.f2583;
            if (c1262 == null) {
                C6635.m9822();
                throw null;
            }
            long j = c1262.f4373;
            long j2 = c1262.f4374;
            long j3 = c1262.f4375;
            this.f2915 = interfaceC1327;
            this.f2916 = 1;
            obj = r4.֏(r5, j, j2, j3, this);
            if (obj == enumC6586) {
                return enumC6586;
            }
        } else {
            if (i != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            C4303.m7198(obj);
        }
        str = (String) obj;
        str2 = str;
        if (str2 == null || str2.length() == 0) {
        }
        return C6549.f19328;
    }
}
