aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--base/src/portbase.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/base/src/portbase.cpp b/base/src/portbase.cpp
index 2f1ec92..a707876 100644
--- a/base/src/portbase.cpp
+++ b/base/src/portbase.cpp
@@ -264,9 +264,13 @@ OMX_ERRORTYPE PortBase::SetPortDefinition(
OMX_S32 nFrameSize = getFrameBufSize(format->eColorFormat,format->nFrameWidth,format->nFrameHeight);
if(nFrameSize!=-1)
temp.nBufferSize = nFrameSize;
-
- format->nStride = pformat->nStride;
- format->nSliceHeight = pformat->nSliceHeight;
+ if (overwrite_readonly) {
+ format->nStride = pformat->nStride;
+ format->nSliceHeight = pformat->nSliceHeight;
+ } else {
+ format->nStride = pformat->nFrameWidth;
+ format->nSliceHeight = pformat->nFrameHeight;
+ }
break;
}