OSDN Git Service

PlaylistFetcher:don't signal a/v eos on subttitle eos
authorRobert Shih <robertshih@google.com>
Mon, 15 Sep 2014 20:36:30 +0000 (13:36 -0700)
committerRobert Shih <robertshih@google.com>
Wed, 17 Sep 2014 18:57:54 +0000 (18:57 +0000)
Bug: 17310061
Change-Id: Ifbca3c12f21171a6e429dca51a250a41051fdd34

media/libstagefright/httplive/LiveSession.cpp

index 7786c27..b465566 100644 (file)
@@ -443,6 +443,23 @@ void LiveSession::onMessageReceived(const sp<AMessage> &msg) {
 
                     ALOGE("XXX Received error %d from PlaylistFetcher.", err);
 
+                    // handle EOS on subtitle tracks independently
+                    AString uri;
+                    if (err == ERROR_END_OF_STREAM && msg->findString("uri", &uri)) {
+                        ssize_t i = mFetcherInfos.indexOfKey(uri);
+                        if (i >= 0) {
+                            const sp<PlaylistFetcher> &fetcher = mFetcherInfos.valueAt(i).mFetcher;
+                            if (fetcher != NULL) {
+                                uint32_t type = fetcher->getStreamTypeMask();
+                                if (type == STREAMTYPE_SUBTITLES) {
+                                    mPacketSources.valueFor(
+                                            STREAMTYPE_SUBTITLES)->signalEOS(err);;
+                                    break;
+                                }
+                            }
+                        }
+                    }
+
                     if (mInPreparationPhase) {
                         postPrepared(err);
                     }