OSDN Git Service

MPEG2TSWriter: Read more immediately if an empty buffer is received
authorMartin Storsjo <martin@martin.st>
Wed, 29 Aug 2012 11:49:28 +0000 (14:49 +0300)
committerMartin Storsjo <martin@martin.st>
Wed, 29 Aug 2012 12:38:25 +0000 (15:38 +0300)
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

index 92f12af..c9ed5bb 100644 (file)
@@ -419,6 +419,8 @@ void MPEG2TSWriter::SourceInfo::onMessageReceived(const sp<AMessage> &msg) {
                     } else {
                         postAVCFrame(buffer);
                     }
+                } else {
+                    readMore();
                 }
 
                 buffer->release();