From: Martin Storsjo Date: Wed, 29 Aug 2012 11:49:28 +0000 (+0300) Subject: MPEG2TSWriter: Read more immediately if an empty buffer is received X-Git-Tag: android-x86-4.4-r1~662^2~54^2~14^2^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=02d18453d54a05c275c03b72a8290f3c9a964446;p=android-x86%2Fframeworks-av.git MPEG2TSWriter: Read more immediately if an empty buffer is received If writing encoded data from an OMXCodec, the last buffer can be an empty buffer (with the EOS flag set, which isn't propagated to MediaBuffer). If we don't retry reading, we won't ever get the EOS error and thus won't properly signal that the source is done. Change-Id: Ibe01dbcd0637fbf0c2529a277e9f208c48e0e8ab --- diff --git a/media/libstagefright/MPEG2TSWriter.cpp b/media/libstagefright/MPEG2TSWriter.cpp index 92f12afaa3..c9ed5bb466 100644 --- a/media/libstagefright/MPEG2TSWriter.cpp +++ b/media/libstagefright/MPEG2TSWriter.cpp @@ -419,6 +419,8 @@ void MPEG2TSWriter::SourceInfo::onMessageReceived(const sp &msg) { } else { postAVCFrame(buffer); } + } else { + readMore(); } buffer->release();