SoftAvc: Fix input offset reset during port reconfiguration
During port reconfiguration, input buffer offset should not be
set to zero. In case input contains more than one header and second
header triggers a change in resolution, then input offset should point to
second header in the subsequent calls to decoder.
Bug: 67761639
Test: ran PoC before/after
Change-Id: I710653506959752d28170e656c1a5a897b02b335
diff --git a/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp b/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp
index dae6e79..1622561 100644
--- a/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp
+++ b/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp
@@ -171,7 +171,7 @@
status_t SoftAVC::resetPlugin() {
mIsInFlush = false;
mReceivedEOS = false;
- mInputOffset = 0;
+
memset(mTimeStamps, 0, sizeof(mTimeStamps));
memset(mTimeStampsValid, 0, sizeof(mTimeStampsValid));
@@ -334,6 +334,7 @@
SoftVideoDecoderOMXComponent::onReset();
mSignalledError = false;
+ mInputOffset = 0;
resetDecoder();
resetPlugin();
}
@@ -465,7 +466,8 @@
free(mFlushOutBuffer);
mFlushOutBuffer = NULL;
}
-
+ } else {
+ mInputOffset = 0;
}
}