summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorronghuawu@chromium.org <ronghuawu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-06 18:16:07 +0000
committerronghuawu@chromium.org <ronghuawu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-06 18:16:07 +0000
commit46bf9d1eeb8c02e08c4208824ab31f7adb159233 (patch)
treeb059c9e7d35172d3c9a5f900402c2858fc739bd0
parent4ef6104a0ac2a75c08fc2df18d0de698c5b1c0ee (diff)
downloadchromium_src-46bf9d1eeb8c02e08c4208824ab31f7adb159233.zip
chromium_src-46bf9d1eeb8c02e08c4208824ab31f7adb159233.tar.gz
chromium_src-46bf9d1eeb8c02e08c4208824ab31f7adb159233.tar.bz2
Use different labels for audio and video tracks. Otherwise peerconnection may
think they are the same track and use same ssrc for them. http://code.google.com/p/webrtc/issues/detail?id=549 TEST=unit test and apprtc Review URL: https://chromiumcodereview.appspot.com/10442080 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140793 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/renderer/media/media_stream_impl.cc5
-rw-r--r--content/renderer/media/media_stream_impl_unittest.cc4
2 files changed, 7 insertions, 2 deletions
diff --git a/content/renderer/media/media_stream_impl.cc b/content/renderer/media/media_stream_impl.cc
index 2d772d5..503a42a 100644
--- a/content/renderer/media/media_stream_impl.cc
+++ b/content/renderer/media/media_stream_impl.cc
@@ -10,6 +10,7 @@
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/string_number_conversions.h"
+#include "base/stringprintf.h"
#include "base/synchronization/waitable_event.h"
#include "base/utf_string_conversions.h"
#include "content/renderer/media/capture_video_decoder.h"
@@ -63,8 +64,8 @@ static void CreateWebKitSourceVector(
WebKit::WebVector<WebKit::WebMediaStreamSource>& webkit_sources) {
ASSERT(devices.size() == webkit_sources.size());
for (size_t i = 0; i < devices.size(); ++i) {
- std::string source_id = label + base::UintToString(
- static_cast<unsigned int>(i));
+ std::string source_id = StringPrintf("%s%d%u", label.c_str(), type,
+ static_cast<unsigned int>(i));
webkit_sources[i].initialize(
UTF8ToUTF16(source_id),
type,
diff --git a/content/renderer/media/media_stream_impl_unittest.cc b/content/renderer/media/media_stream_impl_unittest.cc
index b149ee7..6a2a2e8 100644
--- a/content/renderer/media/media_stream_impl_unittest.cc
+++ b/content/renderer/media/media_stream_impl_unittest.cc
@@ -99,6 +99,10 @@ class MediaStreamImplTest : public ::testing::Test {
EXPECT_EQ(1u, extra_data->local_stream()->audio_tracks()->count());
if (video)
EXPECT_EQ(1u, extra_data->local_stream()->video_tracks()->count());
+ if (audio && video) {
+ EXPECT_NE(extra_data->local_stream()->audio_tracks()->at(0)->label(),
+ extra_data->local_stream()->video_tracks()->at(0)->label());
+ }
return desc;
}