diff options
author | Andreas Huber <andih@google.com> | 2011-09-27 12:12:25 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2011-09-27 12:13:37 -0700 |
commit | eac68baf095aeef54865c28b6888924dc6295cbd (patch) | |
tree | a1ca9c5de638d21e07be1aab9f25d01e118597e7 /media/libmediaplayerservice/nuplayer/StreamingSource.cpp | |
parent | 797ab6072402b12721dc226a9ebde3546e7640e9 (diff) | |
download | frameworks_av-eac68baf095aeef54865c28b6888924dc6295cbd.zip frameworks_av-eac68baf095aeef54865c28b6888924dc6295cbd.tar.gz frameworks_av-eac68baf095aeef54865c28b6888924dc6295cbd.tar.bz2 |
Signal an appropriate error even if there are no active streams yet.
Change-Id: I3ac1053ad288558b62ee18056dfd0a9ce0da8f49
related-to-bug: 5372901
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/StreamingSource.cpp')
-rw-r--r-- | media/libmediaplayerservice/nuplayer/StreamingSource.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/media/libmediaplayerservice/nuplayer/StreamingSource.cpp b/media/libmediaplayerservice/nuplayer/StreamingSource.cpp index 7319e4c..f795654 100644 --- a/media/libmediaplayerservice/nuplayer/StreamingSource.cpp +++ b/media/libmediaplayerservice/nuplayer/StreamingSource.cpp @@ -34,7 +34,7 @@ namespace android { NuPlayer::StreamingSource::StreamingSource(const sp<IStreamSource> &source) : mSource(source), - mEOS(false) { + mFinalResult(OK) { } NuPlayer::StreamingSource::~StreamingSource() { @@ -47,9 +47,9 @@ void NuPlayer::StreamingSource::start() { mStreamListener->start(); } -bool NuPlayer::StreamingSource::feedMoreTSData() { - if (mEOS) { - return false; +status_t NuPlayer::StreamingSource::feedMoreTSData() { + if (mFinalResult != OK) { + return mFinalResult; } for (int32_t i = 0; i < 50; ++i) { @@ -60,7 +60,7 @@ bool NuPlayer::StreamingSource::feedMoreTSData() { if (n == 0) { LOGI("input data EOS reached."); mTSParser->signalEOS(ERROR_END_OF_STREAM); - mEOS = true; + mFinalResult = ERROR_END_OF_STREAM; break; } else if (n == INFO_DISCONTINUITY) { ATSParser::DiscontinuityType type = ATSParser::DISCONTINUITY_SEEK; @@ -92,14 +92,14 @@ bool NuPlayer::StreamingSource::feedMoreTSData() { LOGE("TS Parser returned error %d", err); mTSParser->signalEOS(err); - mEOS = true; + mFinalResult = err; break; } } } } - return true; + return OK; } sp<MetaData> NuPlayer::StreamingSource::getFormat(bool audio) { |