Bug 1094436 - Fix broken speech recognition requiring the wrong type of stream and leaking memory. r=jesup

This commit is contained in:
Andrew Osmond 2014-11-06 06:12:00 -05:00
parent 3673d4f701
commit 3a0324940a

View File

@ -940,11 +940,11 @@ NS_IMPL_ISUPPORTS(SpeechRecognition::GetUserMediaSuccessCallback, nsIDOMGetUserM
NS_IMETHODIMP
SpeechRecognition::GetUserMediaSuccessCallback::OnSuccess(nsISupports* aStream)
{
DOMLocalMediaStream *localStream = nullptr;
nsresult rv = CallQueryInterface(aStream, &localStream);
if (NS_SUCCEEDED(rv)) {
mRecognition->StartRecording(localStream);
nsRefPtr<DOMMediaStream> stream = do_QueryObject(aStream);
if (!stream) {
return NS_ERROR_NO_INTERFACE;
}
mRecognition->StartRecording(stream);
return NS_OK;
}