Avoid crash for stss sync sample number 0 am: 5c364997a3 am: e77a32bd3d am: ab28d49e41 -s ours am: 73db408aa3 am: 0bb0a8e1e8 am: 4d86bef7f7 am: 241f5feb8a am: a7cec6180f am: d022170614 am: cbdc2b7899 am: c9f14c3442 am: 08bb4c4a5b am: f3bab7a1de am: 79f18237f6 am: 143d1a1535
am: d83a7c48f3
Change-Id: Id0f718580239431c237b4edf83716fedd79102f5
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
index 2c37aed..562cd7c 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
@@ -750,12 +750,13 @@
}
mDeferredActions.push_back(
- new FlushDecoderAction(FLUSH_CMD_FLUSH /* audio */,
+ new FlushDecoderAction(
+ (obj != NULL ? FLUSH_CMD_FLUSH : FLUSH_CMD_NONE) /* audio */,
FLUSH_CMD_SHUTDOWN /* video */));
mDeferredActions.push_back(new SetSurfaceAction(surface));
- if (obj != NULL || mAudioDecoder != NULL) {
+ if (obj != NULL) {
if (mStarted) {
// Issue a seek to refresh the video screen only if started otherwise
// the extractor may not yet be started and will assert.
@@ -773,13 +774,13 @@
// again if possible.
mDeferredActions.push_back(
new SimpleAction(&NuPlayer::performScanSources));
- }
- // After a flush without shutdown, decoder is paused.
- // Don't resume it until source seek is done, otherwise it could
- // start pulling stale data too soon.
- mDeferredActions.push_back(
- new ResumeDecoderAction(false /* needNotify */));
+ // After a flush without shutdown, decoder is paused.
+ // Don't resume it until source seek is done, otherwise it could
+ // start pulling stale data too soon.
+ mDeferredActions.push_back(
+ new ResumeDecoderAction(false /* needNotify */));
+ }
processDeferredActions();
break;