Re: android random crash when client call heavily

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Something wired, if I banned mediaplayer, the App will not crash…and pjsip version is 2.6, with openh264
The code list below:

/**
     * 播放提示音,单例模式
     *
     * @param context
     * @param resourceId
     */
    public synchronized void playMedia(Context context, int resourceId, final int sourceType) {
        LogUtil.i(TAG, "playMedia() before isPrepare=" + BaseApplication.isPrepare);
        if (BaseApplication.mediaPlayer == null && !BaseApplication.isPrepare) {
            LogUtil.i(TAG, "playMedia() ing isPrepare=" + BaseApplication.isPrepare);
            BaseApplication.isPrepare = true;
            BaseApplication.mediaPlayer = MediaPlayer.create(context, resourceId);
            BaseApplication.mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
                @Override
                public void onPrepared(MediaPlayer mp) {
                    BaseApplication.mediaPlayer.start();
                }
            });
//        }
//        LogUtil.i(TAG, "playMedia() after isPrepare=" + BaseApplication.isPrepare);
//        if (BaseApplication.mediaPlayer != null && !BaseApplication.mediaPlayer.isPlaying() && BaseApplication.isPrepare) {
            BaseApplication.mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
                @Override
                public void onCompletion(MediaPlayer mediaPlayer) {
                    if (BaseApplication.mediaPlayer != null) {
                        BaseApplication.isPrepare = false;
                        BaseApplication.mediaPlayer.stop();
                        BaseApplication.mediaPlayer.release();
                        BaseApplication.mediaPlayer = null;

                        if (sourceType == 2) {//播放的是忙音
                            handler_ = null;
                            hangUpCall("对方忙碌");
                        }
                    }

                    if (isVibrate && vibrator != null) {
                        isVibrate=false;
                        vibrator.cancel();
                    }
                }
            });
        }
    }

在 2017/5/4 14:06,“pjsip 代表 frogersik”<pjsip-bounces@xxxxxxxxxxxxxxx 代表 frogersik@xxxxxxxxx> 写入:

    Hi, do you have media permission in app? I'm using pjsip on android and
    I don't have this kind of problem.

    Br,
    Andrzej

    W dniu 2017-04-21 o 19:27, 高宇 pisze:
    > Hi all:
    >
    >
    >
    >        Are there any ideas why that Android app with pjsip 2.5 will
    > random crash when tested with heavily call?
    >
    >
    >
    >        Attachment is backtrace of crash log, it’s seems that not crash
    > with specify function but with thread things.
    >
    >
    >
    >        Please someone can help me fix this problem, many thanks.
    >
    >
    >
    >       PS:sorry to use company mailbox send the mail, and very sorry for
    > send this mail again.
    >
    >
    > --
    > Sincerely yours
    >
    >
    >                                    GY
    >
    >


    _______________________________________________
    Visit our blog: http://blog.pjsip.org

    pjsip mailing list
    pjsip@xxxxxxxxxxxxxxx
    http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


保密公告(CONFIDENTIALITY NOTICE): 本邮件仅为指定之个人或实体所使用,可能包含有保密信息、受特殊保护信息或为适用法律豁免披露的信息。若此邮件的读者非指定收件人,我们特此通知您请勿打印、复制、发布、散发、转发本邮件。如果此邮件误送于您,请立即联系发件人,并立即从系统中删除。谢谢。(This e-mail is intended for the use of the individual or entity to which it is addressed and may contain information that is confidential, privileged and exempt from disclosure under applicable law. If the reader of this e-mail is not the intended recipient, you are hereby notified that any printing, copying, dissemination, distribution, disclosure or forwarding of this communication is strictly prohibited. If you have received this communication in error, please contact the sender immediately and delete it from your system. Thank You.)
_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org




[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux