From 02d18453d54a05c275c03b72a8290f3c9a964446 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Wed, 29 Aug 2012 14:49:28 +0300 Subject: [PATCH] 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 --- media/libstagefright/MPEG2TSWriter.cpp | 2 ++ 1 file changed, 2 insertions(+) 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(); -- 2.11.0