From 6c41e622512a99581afcbdbd6ad284237923c942 Mon Sep 17 00:00:00 2001 From: Marco Nelissen Date: Wed, 19 Nov 2014 13:22:23 -0800 Subject: When aggregating buffers, make sure we don't lose data Bug: 18277034 Change-Id: Ia8c35791eea88545a873cad339eb6b5fc25d1d97 --- media/libmediaplayerservice/nuplayer/NuPlayer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp index 4f88f02..59ac80a 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp @@ -1321,6 +1321,12 @@ status_t NuPlayer::feedDecoderInputData(bool audio, const sp &msg) { // This stream is unaffected by the discontinuity return -EWOULDBLOCK; } + } else if (err == ERROR_END_OF_STREAM + && doBufferAggregation && (mAggregateBuffer != NULL)) { + // send out the last bit of aggregated data + reply->setBuffer("buffer", mAggregateBuffer); + mAggregateBuffer.clear(); + err = OK; } reply->setInt32("err", err); -- cgit v1.1