OSDN Git Service

Fix green video when scaling video
authorlambdadroid <lambdadroid@gmail.com>
Tue, 4 Jul 2017 09:29:50 +0000 (11:29 +0200)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Wed, 23 Aug 2017 16:04:56 +0000 (00:04 +0800)
Not sure if this was changed in the newer FFMPEG version, but
sws_scale now takes the srcSliceY and srcSliceH. Currently, the
final height was given in instead of the source height, resulting
in an error.

omx/SoftFFmpegVideo.cpp

index f4386cb..4fdf5ae 100644 (file)
@@ -610,7 +610,7 @@ int32_t SoftFFmpegVideo::drainOneOutputBuffer() {
         return ERR_SWS_FAILED;
     }
     sws_scale(mImgConvertCtx, mFrame->data, mFrame->linesize,
-            0, height, data, linesize);
+            0, mFrame->height, data, linesize);
 
     outHeader->nOffset = 0;
     outHeader->nFilledLen = (outputBufferWidth() * outputBufferHeight() * 3) / 2;