为什么通常VideoView AndroidTV在大约一小时后播放多播时会丢失音频?

时间:2019-08-02 08:16:55

标签: android android-videoview multicast

在Android电视盒上播放多播livetv时遇到问题。我使用VideoView播放多播流,大约一小时后(有时只有10或20分钟),音频流丢失了。视频仍然可以播放,但没有声音,重试播放后,音频恢复正常。请帮我解决问题。谢谢您的帮助。

我使用运行Android TV 8.0(API 26)的Android TV盒

videoView.setFocusable(false);
videoView.setFocusableInTouchMode(false);
videoView.setVideoPath(link); // url of multicast stream.
videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
        @Override
        public void onPrepared(MediaPlayer mediaPlayer) {
            if (playerErrorLayout_IPTV.getVisibility() == View.VISIBLE) {
                playerErrorLayout_IPTV.setVisibility(View.VISIBLE);
            }
        }
    });
videoView.setOnErrorListener(new MediaPlayer.OnErrorListener() {
        @Override
        public boolean onError(MediaPlayer mp, int what, int extra) {
            handler.removeCallbacks(fullScreenRunnable);
            showErrorContentDialog(getString(R.string.error_play));
            return true;
        }
    });
videoView.start();

发生错误时我有一些日志

07-24 15:01:09.589  3008  6365 I NU-NuPlayerRenderer: PTS:   SystemTimeStamp:87696597422
07-24 15:01:09.589  3008  6365 I NU-NuPlayerRenderer: PTS:   Last AudioTimeStamp:87696573422
07-24 15:01:09.589  3008  6365 I NU-NuPlayerRenderer: PTS:   Last VideoTimeStamp:87697802455
07-24 15:01:09.589  3008  6365 I NU-NuPlayerRenderer: PTS:   AV diff:-1205033 ,Ajump:0,Vjump:0
07-24 15:01:09.589  3008  6365 I NU-NuPlayerRenderer: PTS:   mAjumpedNum:6, mAudioJumped till now=1982405518
07-24 15:01:09.589  3008  6365 I NU-NuPlayerRenderer: PTS:   mVjumpedNum:6, mVideoJumped till now=1981342059
07-24 15:01:09.589  3008  6365 I NU-NuPlayerRenderer: PTS:   mTotalAudioJumpedTimeUs:257328000
07-24 15:01:09.589  3008  6365 I NU-NuPlayerRenderer: PTS:   mLastVideoUs:87697922455
07-24 15:01:09.589  3008  6365 I NU-NuPlayerRenderer: PTS:   mLastAudioUs:87696573422
07-24 15:01:09.634  3008  6366 I AmSubtitle: [sendTime]timeUs:87697809945
07-24 15:01:09.668  3008  6366 I AmSubtitle: [sendTime]timeUs:87697849879
07-24 15:01:09.701  3008  6366 I AmSubtitle: [sendTime]timeUs:87697890128
07-24 15:01:09.751  3008  6366 I AmSubtitle: [sendTime]timeUs:87697929974
07-24 15:01:09.775  2909  2909 W HwBinder:2909_1: type=1400 audit(0.0:98347): avc: denied { read } for name="hidraw" dev="sysfs" ino=14793 scontext=u:r:hal_audio_default:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0
07-24 15:01:09.785  3008  6366 I AmSubtitle: [sendTime]timeUs:87697970101
07-24 15:01:09.827  2909  2909 W HwBinder:2909_1: type=1400 audit(0.0:98348): avc: denied { read } for name="hidraw" dev="sysfs" ino=14793 scontext=u:r:hal_audio_default:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0
07-24 15:01:09.835  3008  6366 I AmSubtitle: [sendTime]timeUs:87698010241
07-24 15:01:09.868  3008  6366 I AmSubtitle: [sendTime]timeUs:87698049517
07-24 15:01:09.879  2909  2909 W HwBinder:2909_1: type=1400 audit(0.0:98349): avc: denied { read } for name="hidraw" dev="sysfs" ino=14793 scontext=u:r:hal_audio_default:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0
07-24 15:01:09.902  3008  6366 I AmSubtitle: [sendTime]timeUs:87698090071
07-24 15:01:09.931  2909  2909 W HwBinder:2909_1: type=1400 audit(0.0:98350): avc: denied { read } for name="hidraw" dev="sysfs" ino=14793 scontext=u:r:hal_audio_default:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0
07-24 15:01:09.952  3008  6366 I AmSubtitle: [sendTime]timeUs:87698130129
07-24 15:01:09.986  3008  6366 I AmSubtitle: [sendTime]timeUs:87698171048
07-24 15:01:09.983  2909  2909 W HwBinder:2909_1: type=1400 audit(0.0:98351): avc: denied { read } for name="hidraw" dev="sysfs" ino=14793 scontext=u:r:hal_audio_default:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0
07-24 15:01:10.035  3008  6366 I AmSubtitle: [sendTime]timeUs:87698210103
07-24 15:01:10.054  3008  6363 I NU-GenericSource: -->(Playering)Vcount:2 Acount:0 RendVTime:87698242455 RendATime:87696193420 VNewTime:87699562455 ANewTime:87696573422 Vdiff:1320000 Adiff:380002
07-24 15:01:10.068  3008  6366 I AmSubtitle: [sendTime]timeUs:87698250125
07-24 15:01:10.101  3008  6366 I AmSubtitle: [sendTime]timeUs:87698289431
07-24 15:01:10.152  3008  6366 I AmSubtitle: [sendTime]timeUs:87698329869
07-24 15:01:10.185  3008  6366 I AmSubtitle: [sendTime]timeUs:87698370108
07-24 15:01:10.235  3008  6366 I AmSubtitle: [sendTime]timeUs:87698409976
07-24 15:01:10.268  3008  6366 I AmSubtitle: [sendTime]timeUs:87698449961
07-24 15:01:10.302  3008  6366 I AmSubtitle: [sendTime]timeUs:87698490069
07-24 15:01:10.352  3008  6366 I AmSubtitle: [sendTime]timeUs:87698530084
07-24 15:01:10.385  3008  6366 I AmSubtitle: [sendTime]timeUs:87698570028
07-24 15:01:10.435  3008  6366 I AmSubtitle: [sendTime]timeUs:87698610053
07-24 15:01:10.468  3008  6366 I AmSubtitle: [sendTime]timeUs:87698649625
07-24 15:01:10.502  3008  6366 I AmSubtitle: [sendTime]timeUs:87698690050
07-24 15:01:10.552  3008  6366 I AmSubtitle: [sendTime]timeUs:87698730167
07-24 15:01:10.585  3008  6366 I AmSubtitle: [sendTime]timeUs:87698769527
07-24 15:01:10.636  3008  6366 I AmSubtitle: [sendTime]timeUs:87698810074
07-24 15:01:10.669  3008  6366 I AmSubtitle: [sendTime]timeUs:87698849677
07-24 15:01:10.702  3008  6366 I AmSubtitle: [sendTime]timeUs:87698889671
07-24 15:01:10.752  3008  6366 I AmSubtitle: [sendTime]timeUs:87698929867
07-24 15:01:10.786  3008  6366 I AmSubtitle: [sendTime]timeUs:87698970143
07-24 15:01:10.803  2909  2909 W HwBinder:2909_1: type=1400 audit(0.0:98367): avc: denied { read } for name="hidraw" dev="sysfs" ino=14793 scontext=u:r:hal_audio_default:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0
07-24 15:01:10.836  3008  6366 I AmSubtitle: [sendTime]timeUs:87699010081
07-24 15:01:10.855  2909  2909 W HwBinder:2909_1: type=1400 audit(0.0:98368): avc: denied { read } for name="hidraw" dev="sysfs" ino=14793 scontext=u:r:hal_audio_default:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0
07-24 15:01:10.869  3008  6366 I AmSubtitle: [sendTime]timeUs:87699050061
07-24 15:01:10.903  3008  6366 I AmSubtitle: [sendTime]timeUs:87699090099
07-24 15:01:10.903  2909  2909 W HwBinder:2909_1: type=1400 audit(0.0:98369): avc: denied { read } for name="hidraw" dev="sysfs" ino=14793 scontext=u:r:hal_audio_default:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0
07-24 15:01:10.953  3008  6366 I AmSubtitle: [sendTime]timeUs:87699129973
07-24 15:01:10.955  2909  2909 W HwBinder:2909_1: type=1400 audit(0.0:98370): avc: denied { read } for name="hidraw" dev="sysfs" ino=14793 scontext=u:r:hal_audio_default:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0
07-24 15:01:10.986  3008  6366 I AmSubtitle: [sendTime]timeUs:87699170279
07-24 15:01:11.007  2909  2909 W HwBinder:2909_1: type=1400 audit(0.0:98371): avc: denied { read } for name="hidraw" dev="sysfs" ino=14793 scontext=u:r:hal_audio_default:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0
07-24 15:01:11.036  3008  6366 I AmSubtitle: [sendTime]timeUs:87699210067
07-24 15:01:11.069  3008  6366 I AmSubtitle: [sendTime]timeUs:87699249528
07-24 15:01:11.088  3008  6363 I NU-GenericSource: -->(Playering)Vcount:3 Acount:0 RendVTime:87699282455 RendATime:87696193420 VNewTime:87700722455 ANewTime:87696573422 Vdiff:1440000 Adiff:380002
07-24 15:01:11.103  3008  6366 I AmSubtitle: [sendTime]timeUs:87699290054
07-24 15:01:11.153  3008  6366 I AmSubtitle: [sendTime]timeUs:87699330163
07-24 15:01:11.186  3008  6366 I AmSubtitle: [sendTime]timeUs:87699369544
07-24 15:01:11.236  3008  6366 I AmSubtitle: [sendTime]timeUs:87699410071
07-24 15:01:11.270  3008  6366 I AmSubtitle: [sendTime]timeUs:87699450042
07-24 15:01:11.302  3008  6366 I AmSubtitle: [sendTime]timeUs:87699489525
07-24 15:01:11.353  3008  6366 I AmSubtitle: [sendTime]timeUs:87699530157
07-24 15:01:11.386  3008  6366 I AmSubtitle: [sendTime]timeUs:87699570167
07-24 15:01:11.436  3008  6366 I AmSubtitle: [sendTime]timeUs:87699609524
07-24 15:01:11.470  3008  6366 I AmSubtitle: [sendTime]timeUs:87699650064
07-24 15:01:11.503  3008  6366 I AmSubtitle: [sendTime]timeUs:87699690325
07-24 15:01:11.515  2909  3073 D audio-subMixingFactory: out_standby_subMixingPCM: out_stream(0xaf9cd000) usecase: STREAM_PCM_NORMAL
07-24 15:01:11.515  2909  3073 I audio-subMixingFactory: ++usecase_change_validate_l_sm(), dev usecase masks = 0x1, is_standby = 1, out usecase STREAM_PCM_NORMAL
07-24 15:01:11.515  2909  3073 I audio-subMixingFactory: --usecase_change_validate_l_sm(), dev usecase masks = 0, is_standby = 1, out usecase STREAM_PCM_NORMAL
07-24 15:01:11.515  2909  3073 I amlaudioMixer: ++delete_mixer_input_port port ID: 0```

0 个答案:

没有答案