CCodec: don't use array mode if in block model
Bug: 148410627
Test: atest CtsMediaTestCases:MediaCodecBlockModelTest
Change-Id: I5242f730531f90ffd06456502059ebaf88a30490
diff --git a/media/codec2/sfplugin/CCodecBufferChannel.cpp b/media/codec2/sfplugin/CCodecBufferChannel.cpp
index ae95336..035dca8 100644
--- a/media/codec2/sfplugin/CCodecBufferChannel.cpp
+++ b/media/codec2/sfplugin/CCodecBufferChannel.cpp
@@ -1263,10 +1263,12 @@
}
if (oStreamFormat.value == C2BufferData::LINEAR) {
- // WORKAROUND: if we're using early CSD workaround we convert to
- // array mode, to appease apps assuming the output
- // buffers to be of the same size.
- output->buffers = output->buffers->toArrayMode(numOutputSlots);
+ if (buffersBoundToCodec) {
+ // WORKAROUND: if we're using early CSD workaround we convert to
+ // array mode, to appease apps assuming the output
+ // buffers to be of the same size.
+ output->buffers = output->buffers->toArrayMode(numOutputSlots);
+ }
int32_t channelCount;
int32_t sampleRate;