Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2973994a authored by Robert Shih's avatar Robert Shih Committed by Android (Google) Code Review
Browse files

Merge "PlaylistFetcher:don't signal a/v eos on subttitle eos" into lmp-dev

parents 21a1d72b 15f8ecfa
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -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);
                    }