This might be called whilst the codec has already finished decoding
and is not available for flushing.
Fixes the adaptative HEVC CTS tests.
Change-Id: I80ad95b23a4ba230256ffb7c6df6af4d99ef65a6
void SoftFFmpegVideo::onPortFlushCompleted(OMX_U32 portIndex) {
ALOGV("ffmpeg video decoder flush port(%u)", portIndex);
if (portIndex == kInputPortIndex) {
- if (mCtx) {
+ if (mCtx && avcodec_is_open(mCtx)) {
//Make sure that the next buffer output does not still
//depend on fragments from the last one decoded.
avcodec_flush_buffers(mCtx);