OSDN Git Service

stagefright-plugins: Fix video of resolution 320x240
authorKeith Mok <kmok@cyngn.com>
Wed, 9 Dec 2015 22:32:20 +0000 (14:32 -0800)
committerGerrit Code Review <gerrit@cyanogenmod.org>
Thu, 10 Dec 2015 07:09:37 +0000 (23:09 -0800)
commit487d143895ee1d79c55d037a66f739f45a5f46d6
tree8424f6eee6ca1b39c9e976e5e69ead3cd3e8de03
parentf7f46ccb08b54ad0f16b78934f8f7bbc35d235b2
stagefright-plugins: Fix video of resolution 320x240

Video of resoltuion 320x240 cannot be played correctly.
Since the width and height of mCtx are not set and eqauls to zero.
The width and height of mCts are supposed to be set by
OMX_IndexParamPortDefinition, but the default size is
320x240. So in function internalSetParameter,
case OMX_IndexParamPortDefinition,
(newWidth != oldWidth || newHeight != oldHeight)
is always false and skipped setting mCts->width and height.
This results avcodec_open2 fails and an error is printed out
"Picture size 0x0 is invalid".

Setting mCtx->width and height to mWidth and mHeight solves
the problem.

Change-Id: I5dec4e4af66afded27dc4e6d2835249262f90528
omx/SoftFFmpegVideo.cpp