File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
media/libmediaplayerservice/nuplayer Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -463,11 +463,24 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) {
463463 {
464464 LOGV (" kWhatReset" );
465465
466+ if (mRenderer != NULL ) {
467+ // There's an edge case where the renderer owns all output
468+ // buffers and is paused, therefore the decoder will not read
469+ // more input data and will never encounter the matching
470+ // discontinuity. To avoid this, we resume the renderer.
471+
472+ if (mFlushingAudio == AWAITING_DISCONTINUITY
473+ || mFlushingVideo == AWAITING_DISCONTINUITY) {
474+ mRenderer ->resume ();
475+ }
476+ }
477+
466478 if (mFlushingAudio != NONE || mFlushingVideo != NONE) {
467479 // We're currently flushing, postpone the reset until that's
468480 // completed.
469481
470- LOGV (" postponing reset" );
482+ LOGV (" postponing reset mFlushingAudio=%d, mFlushingVideo=%d" ,
483+ mFlushingAudio , mFlushingVideo );
471484
472485 mResetPostponed = true ;
473486 break ;
Original file line number Diff line number Diff line change @@ -628,11 +628,16 @@ void NuPlayer::Renderer::onPause() {
628628 mAudioSink ->pause ();
629629 }
630630
631+ LOGV (" now paused audio queue has %d entries, video has %d entries" ,
632+ mAudioQueue .size (), mVideoQueue .size ());
633+
631634 mPaused = true ;
632635}
633636
634637void NuPlayer::Renderer::onResume () {
635- CHECK (mPaused );
638+ if (!mPaused ) {
639+ return ;
640+ }
636641
637642 if (mHasAudio ) {
638643 mAudioSink ->start ();
You can’t perform that action at this time.
0 commit comments