Bug 830648 - AudioChannelAgent::StartPlaying() should check if already registered to AudioChannelService., r=mchen

This commit is contained in:
Andrea Marchesini 2013-01-15 15:31:19 +01:00
Родитель 2ebebe85a4
Коммит 95d3343452
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -20,6 +20,9 @@ AudioChannelAgent::AudioChannelAgent()
AudioChannelAgent::~AudioChannelAgent()
{
if (mIsRegToService) {
StopPlaying();
}
}
/* readonly attribute long audioChannelType; */
@ -66,7 +69,7 @@ NS_IMETHODIMP AudioChannelAgent::StartPlaying(bool *_retval)
{
AudioChannelService *service = AudioChannelService::GetAudioChannelService();
if (mAudioChannelType == AUDIO_AGENT_CHANNEL_ERROR ||
service == nullptr) {
service == nullptr || mIsRegToService) {
return NS_ERROR_FAILURE;
}
@ -81,7 +84,7 @@ NS_IMETHODIMP AudioChannelAgent::StartPlaying(bool *_retval)
NS_IMETHODIMP AudioChannelAgent::StopPlaying(void)
{
if (mAudioChannelType == AUDIO_AGENT_CHANNEL_ERROR ||
mIsRegToService == false) {
!mIsRegToService) {
return NS_ERROR_FAILURE;
}