Merge "Fix cannot play issue after seeking for Vorbis Playback." am: 3e0608b615 am: 3258fc0472 am: cc51e69019
am: ba293e4320
Change-Id: I4ea41b5c52d5be44010de60de0dfc473771872f6
diff --git a/media/libstagefright/codecs/vorbis/dec/SoftVorbis.cpp b/media/libstagefright/codecs/vorbis/dec/SoftVorbis.cpp
index 76a400c..8d0ea3a 100644
--- a/media/libstagefright/codecs/vorbis/dec/SoftVorbis.cpp
+++ b/media/libstagefright/codecs/vorbis/dec/SoftVorbis.cpp
@@ -572,16 +572,17 @@
}
void SoftVorbis::onPortFlushCompleted(OMX_U32 portIndex) {
- if (portIndex == 0 && mState != NULL) {
- // Make sure that the next buffer output does not still
- // depend on fragments from the last one decoded.
-
+ if (portIndex == 0) {
mInputBufferCount = 0;
mNumFramesOutput = 0;
mSawInputEos = false;
mSignalledOutputEos = false;
mNumFramesLeftOnPage = -1;
- vorbis_dsp_restart(mState);
+ if (mState != NULL) {
+ // Make sure that the next buffer output does not still
+ // depend on fragments from the last one decoded.
+ vorbis_dsp_restart(mState);
+ }
}
}
@@ -603,6 +604,7 @@
mSawInputEos = false;
mSignalledOutputEos = false;
mSignalledError = false;
+ mNumFramesLeftOnPage = -1;
mOutputPortSettingsChange = NONE;
}