Skip to content

Commit d5586fc

Browse files
committed
Simplify some code
1 parent 494d702 commit d5586fc

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/description.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -872,12 +872,11 @@ void Description::Entry::parseSdpLine(string_view line) {
872872

873873
const auto rid = list[0];
874874
const auto direction = list[1];
875-
const auto attr_list = list.size() >= 3 ? list[2] : "";
876875

877876
auto builder = RidBuilder(string(rid));
878877

879-
if (!attr_list.empty()) {
880-
const auto attr_list_parsed = parse_attr_list(attr_list);
878+
if (list.size() == 3) {
879+
const auto attr_list_parsed = parse_attr_list(list[2]);
881880
for (const auto& [attr_key, attr_value] : attr_list_parsed) {
882881
if (attr_key == "max-width") {
883882
builder.max_width(to_integer<uint32_t>(attr_value));

test/simulcast_sdp_parsing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ TestResult test_simulcast_sdp_parsing() {
5959
{
6060
Description::Video video0("video0");
6161
video0.parseSdpLine("a=rid:layer0 send max-width=1920;max-height=1080;max-fps=60");
62-
video0.parseSdpLine("a=rid:layer1 send max-height=720;max-fps=30;max-br=1500000;foo=bar");
62+
video0.parseSdpLine("a=rid:layer1 send max-height=720;max-fps=20;max-fps=30;max-br=1500000;foo=bar");
6363

6464
const auto rid_list = video0.rids();
6565
if (rid_list.size() != 2) {

0 commit comments

Comments
 (0)