Merge "DashPlayer: Reinstantiate audio decoder while handling discontinuity"
diff --git a/dashplayer/DashPlayer.cpp b/dashplayer/DashPlayer.cpp
index 2dbf530..f78403c 100644
--- a/dashplayer/DashPlayer.cpp
+++ b/dashplayer/DashPlayer.cpp
@@ -1022,6 +1022,18 @@
}
void DashPlayer::finishFlushIfPossible() {
+
+ /* check if Audio Decoder has been shutdown for handling audio discontinuity
+ ,in that case Audio decoder has to be reinstaniated*/
+ if (mAudioDecoder == NULL && (mFlushingAudio == SHUT_DOWN) &&
+ !mResetInProgress && !mResetPostponed &&
+ ((mVideoDecoder != NULL) && (mFlushingVideo == NONE || mFlushingVideo == AWAITING_DISCONTINUITY)))
+ {
+ ALOGV("Resuming Audio after Shutdown(Discontinuity)");
+ mFlushingAudio = NONE;
+ postScanSources();
+ return;
+ }
//If reset was postponed after one of the streams is flushed, complete it now
if (mResetPostponed) {
ALOGV("finishFlushIfPossible Handle reset postpone ");