Check the number of playout channels instead of the send channels in StopPlayout()
BUG=2467 R=henrika@webrtc.org Review URL: https://webrtc-codereview.appspot.com/2420004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4989 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -76,9 +76,9 @@ void SharedData::set_audio_processing(AudioProcessing* audioproc) {
|
|||||||
_outputMixerPtr->SetAudioProcessingModule(audioproc);
|
_outputMixerPtr->SetAudioProcessingModule(audioproc);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t SharedData::NumOfSendingChannels() {
|
int SharedData::NumOfSendingChannels() {
|
||||||
ChannelManager::Iterator it(&_channelManager);
|
ChannelManager::Iterator it(&_channelManager);
|
||||||
uint16_t sending_channels = 0;
|
int sending_channels = 0;
|
||||||
|
|
||||||
for (ChannelManager::Iterator it(&_channelManager); it.IsValid();
|
for (ChannelManager::Iterator it(&_channelManager); it.IsValid();
|
||||||
it.Increment()) {
|
it.Increment()) {
|
||||||
@@ -89,6 +89,19 @@ uint16_t SharedData::NumOfSendingChannels() {
|
|||||||
return sending_channels;
|
return sending_channels;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int SharedData::NumOfPlayingChannels() {
|
||||||
|
ChannelManager::Iterator it(&_channelManager);
|
||||||
|
int playout_channels = 0;
|
||||||
|
|
||||||
|
for (ChannelManager::Iterator it(&_channelManager); it.IsValid();
|
||||||
|
it.Increment()) {
|
||||||
|
if (it.GetChannel()->Playing())
|
||||||
|
++playout_channels;
|
||||||
|
}
|
||||||
|
|
||||||
|
return playout_channels;
|
||||||
|
}
|
||||||
|
|
||||||
void SharedData::SetLastError(int32_t error) const {
|
void SharedData::SetLastError(int32_t error) const {
|
||||||
_engineStatistics.SetLastError(error);
|
_engineStatistics.SetLastError(error);
|
||||||
}
|
}
|
||||||
|
@@ -56,7 +56,8 @@ public:
|
|||||||
_audioDeviceLayer = layer;
|
_audioDeviceLayer = layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t NumOfSendingChannels();
|
int NumOfSendingChannels();
|
||||||
|
int NumOfPlayingChannels();
|
||||||
|
|
||||||
// Convenience methods for calling statistics().SetLastError().
|
// Convenience methods for calling statistics().SetLastError().
|
||||||
void SetLastError(int32_t error) const;
|
void SetLastError(int32_t error) const;
|
||||||
|
@@ -999,7 +999,7 @@ int32_t VoEBaseImpl::StopPlayout() {
|
|||||||
VoEId(_shared->instance_id(), -1),
|
VoEId(_shared->instance_id(), -1),
|
||||||
"VoEBaseImpl::StopPlayout()");
|
"VoEBaseImpl::StopPlayout()");
|
||||||
// Stop audio-device playing if no channel is playing out
|
// Stop audio-device playing if no channel is playing out
|
||||||
if (_shared->NumOfSendingChannels() == 0) {
|
if (_shared->NumOfPlayingChannels() == 0) {
|
||||||
if (_shared->audio_device()->StopPlayout() != 0) {
|
if (_shared->audio_device()->StopPlayout() != 0) {
|
||||||
_shared->SetLastError(VE_CANNOT_STOP_PLAYOUT,
|
_shared->SetLastError(VE_CANNOT_STOP_PLAYOUT,
|
||||||
kTraceError,
|
kTraceError,
|
||||||
|
Reference in New Issue
Block a user