summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/NuPlayer.cpp')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayer.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
index ceedb40..ef4abd4 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
@@ -832,24 +832,31 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) {
finishFlushIfPossible();
} else if (what == Decoder::kWhatError) {
- ALOGE("Received error from %s decoder, aborting playback.",
- audio ? "audio" : "video");
-
status_t err;
if (!msg->findInt32("err", &err)) {
err = UNKNOWN_ERROR;
}
- mRenderer->queueEOS(audio, err);
+ ALOGE("received error from %s decoder %#x", audio ? "audio" : "video", err);
+
+ ALOGI("shutting down %s", audio ? "audio" : "video");
if (audio && mFlushingAudio != NONE) {
+ mRenderer->queueEOS(audio, err);
mAudioDecoder.clear();
++mAudioDecoderGeneration;
mFlushingAudio = SHUT_DOWN;
- } else if (!audio && mFlushingVideo != NONE){
+ finishFlushIfPossible();
+ } else if (!audio && mFlushingVideo != NONE) {
+ mRenderer->queueEOS(audio, err);
mVideoDecoder.clear();
++mVideoDecoderGeneration;
mFlushingVideo = SHUT_DOWN;
+ finishFlushIfPossible();
+ } else {
+ mDeferredActions.push_back(
+ new ShutdownDecoderAction(audio, !audio /* video */));
+ processDeferredActions();
+ notifyListener(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, err);
}
- finishFlushIfPossible();
} else if (what == Decoder::kWhatDrainThisBuffer) {
renderBuffer(audio, msg);
} else {