Bug 1058022 - B2G crashes during RTSP and HTTP streaming playback. r=sworkman

This commit is contained in:
Henry Chang 2014-09-10 16:09:48 +08:00
parent 0c6bd09dac
commit ea779c5af2

View File

@ -107,7 +107,12 @@ void ARTPConnection::removeStream(PRFileDesc *rtpSocket, PRFileDesc *rtcpSocket)
sp<AMessage> msg = new AMessage(kWhatRemoveStream, id()); sp<AMessage> msg = new AMessage(kWhatRemoveStream, id());
msg->setPointer("rtp-socket", rtpSocket); msg->setPointer("rtp-socket", rtpSocket);
msg->setPointer("rtcp-socket", rtcpSocket); msg->setPointer("rtcp-socket", rtcpSocket);
msg->post();
// Since the caller will close the sockets after this function
// returns, we need to use a blocking post to prevent from polling
// closed sockets.
sp<AMessage> response;
msg->postAndAwaitResponse(&response);
} }
static void bumpSocketBufferSize(PRFileDesc *s) { static void bumpSocketBufferSize(PRFileDesc *s) {
@ -177,6 +182,10 @@ void ARTPConnection::onMessageReceived(const sp<AMessage> &msg) {
case kWhatRemoveStream: case kWhatRemoveStream:
{ {
onRemoveStream(msg); onRemoveStream(msg);
sp<AMessage> ack = new AMessage;
uint32_t replyID;
CHECK(msg->senderAwaitsResponse(&replyID));
ack->postReply(replyID);
break; break;
} }