From adec9271b0e3bf1dd977c66c6acd3683d50576ad Mon Sep 17 00:00:00 2001 From: "mflodman@webrtc.org" Date: Tue, 3 Jan 2012 21:43:15 +0000 Subject: [PATCH] Correcting VieChannelManager bug. Review URL: http://webrtc-codereview.appspot.com/337010 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1320 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/video_engine/vie_channel_manager.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/video_engine/vie_channel_manager.cc b/src/video_engine/vie_channel_manager.cc index 8790da803..f88efe1d5 100644 --- a/src/video_engine/vie_channel_manager.cc +++ b/src/video_engine/vie_channel_manager.cc @@ -473,10 +473,18 @@ bool ViEChannelManager::ChannelUsingViEEncoder(int channel_id) const { void ViEChannelManager::ChannelsUsingViEEncoder(int channel_id, ChannelList* channels) const { CriticalSectionScoped cs(*channel_id_critsect_); - assert(vie_encoder_map_.Find(channel_id)); + MapItem* original_item = vie_encoder_map_.Find(channel_id); + assert(original_item); + ViEEncoder* original_encoder = + static_cast(original_item->GetItem()); + MapItem* channel_item = channel_map_.First(); while (channel_item) { - if (vie_encoder_map_.Find(channel_item->GetId())) { + MapItem* compare_item = vie_encoder_map_.Find(channel_item->GetId()); + assert(compare_item); + ViEEncoder* compare_encoder = + static_cast(compare_item->GetItem()); + if (compare_encoder == original_encoder) { channels->push_back(static_cast(channel_item->GetItem())); } channel_item = channel_map_.Next(channel_item);