OSDN Git Service

stagefright-plugins: Wait for reader shutdown on EOS
authorSteve Kondik <steve@cyngn.com>
Wed, 30 Dec 2015 02:08:01 +0000 (18:08 -0800)
committerSteve Kondik <steve@cyngn.com>
Wed, 30 Dec 2015 02:08:01 +0000 (18:08 -0800)
 * Source will flag EOS but we need to stick around during gapless
   playback, otherwise the extractor aborts early and can confuse
   apps.
 * Fixes gapless transitions during FLAC playback with Tidal.

Change-Id: Icbdaa180d39d626b163089f5686b7a1e4afcfbc2

extractor/FFmpegExtractor.cpp

index c8a4799..d881209 100644 (file)
@@ -1205,7 +1205,8 @@ void FFmpegExtractor::readerEntry() {
         if (ret < 0) {
             mEOF = true;
             eof = true;
-            if (mFormatCtx->pb && mFormatCtx->pb->error) {
+            if (mFormatCtx->pb && mFormatCtx->pb->error &&
+                    mFormatCtx->pb->error != ERROR_END_OF_STREAM) {
                 ALOGE("mFormatCtx->pb->error: %d", mFormatCtx->pb->error);
                 break;
             }