From a9329dbae21cabd4b860e729ecd7769f5bec9ac7 Mon Sep 17 00:00:00 2001 From: Qiang Chen Date: Thu, 14 Dec 2017 14:05:43 -0800 Subject: [PATCH] Bug Fix: Peers Cannot Communicate If One With Stereo Codec, One Not When Chromium hooks up with the stereo codec, then it has difficulty communicating with a google chrome without stereo codec. By design, we do allow codec choice for the standalone codecs, but the problem is that we do not handle the payload correctly, and thus the existence of stereo codec will remove the payload registry of the standalone version of its associated codec. (For example, stereo codec on top of VP9 will remove the payload registry of standalone VP9 codec.) This CL fixes the issue. When generating payload data, we should use "stereo" as payload name, instead of its associated codecs. Bug: webrtc:8657 Change-Id: I9e0b54de6bd41d370b9353f9553c998e4049789f Reviewed-on: https://webrtc-review.googlesource.com/33122 Reviewed-by: Emircan Uysaler Reviewed-by: Stefan Holmer Commit-Queue: Qiang Chen Cr-Commit-Position: refs/heads/master@{#21523} --- modules/video_coding/video_codec_initializer.cc | 2 ++ video/video_receive_stream.cc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/modules/video_coding/video_codec_initializer.cc b/modules/video_coding/video_codec_initializer.cc index c5cd452b04..9b259f6fdd 100644 --- a/modules/video_coding/video_codec_initializer.cc +++ b/modules/video_coding/video_codec_initializer.cc @@ -50,6 +50,8 @@ bool VideoCodecInitializer::SetupCodec( return false; } codec->codecType = kVideoCodecStereo; + strncpy(codec->plName, settings.payload_name.c_str(), + sizeof(codec->plName)); return true; } diff --git a/video/video_receive_stream.cc b/video/video_receive_stream.cc index 9325054605..d284a7be93 100644 --- a/video/video_receive_stream.cc +++ b/video/video_receive_stream.cc @@ -65,6 +65,8 @@ VideoCodec CreateDecoderVideoCodec(const VideoReceiveStream::Decoder& decoder) { associated_decoder.payload_name = CodecTypeToPayloadString(kVideoCodecVP9); VideoCodec associated_codec = CreateDecoderVideoCodec(associated_decoder); associated_codec.codecType = kVideoCodecStereo; + strncpy(associated_codec.plName, decoder.payload_name.c_str(), + sizeof(associated_codec.plName)); return associated_codec; }