Bug 952006 - [RTSP][Video] System crash while RTSP reconnecting. r=sworkman

This commit is contained in:
Ethan Tseng 2013-12-19 16:51:23 +08:00
parent 9a249997d3
commit 8f9a5a015b

View File

@ -476,11 +476,16 @@ void RTSPSource::onMessageReceived(const sp<AMessage> &msg) {
void RTSPSource::onConnected(bool isSeekable)
{
CHECK(mAudioTrack == NULL);
CHECK(mVideoTrack == NULL);
CHECK(mHandler != NULL);
CHECK(mListener != NULL);
// Clean up audio and video tracks.
// In the case of RTSP reconnect, audio/video tracks might be created by
// previous onConnected event.
mAudioTrack = NULL;
mVideoTrack = NULL;
mTracks.clear();
size_t numTracks = mHandler->countTracks();
for (size_t i = 0; i < numTracks; ++i) {
int32_t timeScale;