diff options
author | Andreas Huber <andih@google.com> | 2010-10-19 12:18:51 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-10-20 15:12:05 -0700 |
commit | 6a05c9e912aeb8bfe1ef99516def91a177a481b6 (patch) | |
tree | 1905112ee50a041d60e8170314761f25d3664294 /media/libstagefright/AwesomePlayer.cpp | |
parent | 6a9da9fc558263548ebfbae2cbf177eb7454a41b (diff) | |
download | frameworks_av-6a05c9e912aeb8bfe1ef99516def91a177a481b6.zip frameworks_av-6a05c9e912aeb8bfe1ef99516def91a177a481b6.tar.gz frameworks_av-6a05c9e912aeb8bfe1ef99516def91a177a481b6.tar.bz2 |
If we basically finished the preparation phase and are only buffering enough data to start playback, cancel this early on reset().
Change-Id: I71a59d5e019e7b9ec3d9375d6231cc301ad3999b
Diffstat (limited to 'media/libstagefright/AwesomePlayer.cpp')
-rw-r--r-- | media/libstagefright/AwesomePlayer.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index d172eef..a86ec7f 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -412,6 +412,12 @@ void AwesomePlayer::reset_l() { LOGI("interrupting the connection process"); mConnectingDataSource->disconnect(); } + + if (mFlags & PREPARING_CONNECTED) { + // We are basically done preparing, we're just buffering + // enough data to start playback, we can safely interrupt that. + finishAsyncPrepare_l(); + } } while (mFlags & PREPARING) { @@ -1625,7 +1631,7 @@ void AwesomePlayer::abortPrepare(status_t err) { } mPrepareResult = err; - mFlags &= ~(PREPARING|PREPARE_CANCELLED); + mFlags &= ~(PREPARING|PREPARE_CANCELLED|PREPARING_CONNECTED); mAsyncPrepareEvent = NULL; mPreparedCondition.broadcast(); } @@ -1673,6 +1679,8 @@ void AwesomePlayer::onPrepareAsyncEvent() { } } + mFlags |= PREPARING_CONNECTED; + if (mCachedSource != NULL || mRTSPController != NULL) { postBufferingEvent_l(); } else { @@ -1692,7 +1700,7 @@ void AwesomePlayer::finishAsyncPrepare_l() { } mPrepareResult = OK; - mFlags &= ~(PREPARING|PREPARE_CANCELLED); + mFlags &= ~(PREPARING|PREPARE_CANCELLED|PREPARING_CONNECTED); mFlags |= PREPARED; mAsyncPrepareEvent = NULL; mPreparedCondition.broadcast(); |