CCodec: use client-provided max input size when necessary

Bug: 117854878
Bug: 118413563
Test: atest GtsExoPlayerTestCases:DashTest#testVp9Fixed360p
Test: atest --test-mapping frameworks/av/media/libstagefright:postsubmit
Change-Id: I30ab735c7ae9576024f144a3ab6bc3ae264dfa36
Merged-In: I30ab735c7ae9576024f144a3ab6bc3ae264dfa36
(cherry picked from commit 28d9c7a38d4905f2f9094d17dc6a8c179a5a17cf)
(cherry picked from commit b6e77fa69650cc11411edf9feea90a9c64aa806f)
diff --git a/media/sfplugin/CCodec.cpp b/media/sfplugin/CCodec.cpp
index 7c4fb93..ae6beaa 100644
--- a/media/sfplugin/CCodec.cpp
+++ b/media/sfplugin/CCodec.cpp
@@ -836,15 +836,17 @@
 
         // TODO: do this based on component requiring linear allocator for input
         if ((config->mDomain & Config::IS_DECODER) || (config->mDomain & Config::IS_AUDIO)) {
-            // For decoders, warn that overriding client's max input size if necessary.
-            if ((config->mDomain & Config::IS_DECODER)) {
-                if (clientSpecifiedInputSize && (uint32_t)clientInputSize < maxInputSize.value) {
+            if (clientSpecifiedInputSize) {
+                // Warn that we're overriding client's max input size if necessary.
+                if ((uint32_t)clientInputSize < maxInputSize.value) {
                     ALOGD("client requested max input size %d, which is smaller than "
                           "what component recommended (%u); overriding with component "
                           "recommendation.", clientInputSize, maxInputSize.value);
                     ALOGW("This behavior is subject to change. It is recommended that "
                           "app developers double check whether the requested "
                           "max input size is in reasonable range.");
+                } else {
+                    maxInputSize.value = clientInputSize;
                 }
             }
             // Pass max input size on input format to the buffer channel (if supplied by the