From 742132a032ddc1dafc13f5d152ae99853ff4b69c Mon Sep 17 00:00:00 2001 From: Sidipotu Ashok Date: Tue, 27 Oct 2015 23:06:22 +0530 Subject: MediaCodec: reset size to zero for EOS. testflush CTS test doesnt have logic to detect EOS currently, reset the size to zero in Mediacodec, on behalf of the CTS test. CRs-Fixed: 911338 Change-Id: I31727a00e0edf5604d0409fecbd976334508e6d7 --- media/libstagefright/MediaCodec.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'media/libstagefright/MediaCodec.cpp') diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp index b6bea65..83b378f 100644 --- a/media/libstagefright/MediaCodec.cpp +++ b/media/libstagefright/MediaCodec.cpp @@ -2368,7 +2368,12 @@ status_t MediaCodec::onQueueInputBuffer(const sp &msg) { } if (offset + size > info->mData->capacity()) { - return -EINVAL; + if ( ((int)size == (int)-1) && !(flags & BUFFER_FLAG_EOS)) { + size = 0; + ALOGD("EOS, reset size to zero"); + } + else + return -EINVAL; } sp reply = info->mNotify; -- cgit v1.1