Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sessions with Multiple Media yield embedded, redundant \r\n #209

Open
thutchmoto opened this issue Mar 9, 2020 · 1 comment
Open

Sessions with Multiple Media yield embedded, redundant \r\n #209

thutchmoto opened this issue Mar 9, 2020 · 1 comment
Assignees
Labels
Milestone

Comments

@thutchmoto
Copy link

Adding multiple media to a manually constructed SdpSession results in successive \r\n:

v=0
o=- 1000 1001 IN IP4 127.0.0.1
s=Test A/V Session
m=audio 10000 RTP/AVP 0

m=video 11000 RTP/AVP 96

Such output will trip up many other SDP parsers.

Code to produce the issue:

let origin = SdpOrigin {
    username: "-".to_string(),
    session_id: 1_000,
    session_version: 1_001,
    unicast_addr: ExplicitlyTypedAddress::from(Ipv4Addr::new(127, 0, 0, 1))
};
let mut session = SdpSession::new(0, origin, "Test A/V Session".to_string());

let audio = SdpMedia::new(SdpMediaLine {
    media: SdpMediaValue::Audio,
    port: 10_000,
    port_count: 0,
    proto: SdpProtocolValue::RtpAvp,
    formats: SdpFormatList::Integers(vec![0])
});
session.media.push(audio);

let video = SdpMedia::new(SdpMediaLine {
    media: SdpMediaValue::Video,
    port: 11_000,
    port_count: 0,
    proto: SdpProtocolValue::RtpAvp,
    formats: SdpFormatList::Integers(vec![96])
});
session.media.push(video);

let as_str = format!("{}", session);
println!("{}", as_str);

Only an issue when generating sdp payloads: #207

@na-g
Copy link
Collaborator

na-g commented Mar 9, 2020

Thanks for the report!

@na-g na-g self-assigned this Jan 16, 2021
@na-g na-g added the bug label Jan 16, 2021
@na-g na-g added this to the 0.3 milestone Jan 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants