Fix for issue 3410180: Small green lines at end of surface after removing last media item

Change-Id: I49695d5d77709da66ffa44d648b35e194f069a7f
diff --git a/libvideoeditor/lvpp/VideoEditorPreviewController.cpp b/libvideoeditor/lvpp/VideoEditorPreviewController.cpp
index 744d410..fd04fd5 100755
--- a/libvideoeditor/lvpp/VideoEditorPreviewController.cpp
+++ b/libvideoeditor/lvpp/VideoEditorPreviewController.cpp
@@ -700,18 +700,14 @@
         mTarget = NULL;

     }

 

-    if(mOutputVideoWidth == 0) {

-        mOutputVideoWidth = pFrameStr->uiFrameWidth;

-    }

-    if(mOutputVideoHeight == 0) {

-        mOutputVideoHeight = pFrameStr->uiFrameHeight;

-    }

+    outputBufferWidth = pFrameStr->uiFrameWidth;

+    outputBufferHeight = pFrameStr->uiFrameHeight;

 

     // Initialize the renderer

     if(mTarget == NULL) {

         mTarget = new PreviewRenderer(

-            OMX_COLOR_FormatYUV420Planar, surface, mOutputVideoWidth, mOutputVideoHeight,

-            mOutputVideoWidth, mOutputVideoHeight, 0);

+            OMX_COLOR_FormatYUV420Planar, surface, outputBufferWidth, outputBufferHeight,

+            outputBufferWidth, outputBufferHeight, 0);

         if(mTarget == NULL) {

             LOGE("renderPreviewFrame: cannot create PreviewRenderer");

             return M4ERR_ALLOC;

@@ -727,8 +723,8 @@
 

     // Set the output YUV420 plane to be compatible with YV12 format

     //In YV12 format, sizes must be even

-    M4OSA_UInt32 yv12PlaneWidth = ((mOutputVideoWidth +1)>>1)<<1;

-    M4OSA_UInt32 yv12PlaneHeight = ((mOutputVideoHeight+1)>>1)<<1;

+    M4OSA_UInt32 yv12PlaneWidth = ((outputBufferWidth +1)>>1)<<1;

+    M4OSA_UInt32 yv12PlaneHeight = ((outputBufferHeight+1)>>1)<<1;

 

     prepareYV12ImagePlane(planeOut, yv12PlaneWidth, yv12PlaneHeight,

      (M4OSA_UInt32)outBufferStride, (M4VIFI_UInt8 *)outBuffer);