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

Fix parsing integer framerate. Release 1.0.1 #51

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

sgfn
Copy link
Member

@sgfn sgfn commented Sep 19, 2024

Passing a=framerate:30 in SDP raises.
Discovered during the workshop by an attendee who used the Meetecho WHIP client

16:05:25.267 [error] GenServer {Broadcaster.PeerRegistry, "8620e7f162"} terminating
** (ArgumentError) errors were found at the given arguments:

  * 1st argument: not a textual representation of a float

    :erlang.binary_to_float("30")
    (ex_sdp 1.0.0) lib/ex_sdp/attribute.ex:175: ExSDP.Attribute.parse_framerate/1
    (ex_sdp 1.0.0) lib/ex_sdp/media.ex:142: ExSDP.Media.parse_optional/2
    (ex_sdp 1.0.0) lib/ex_sdp/parser.ex:143: ExSDP.Parser.parse_line/2
    (ex_sdp 1.0.0) lib/ex_sdp/parser.ex:40: ExSDP.Parser.do_parse/2
    (ex_webrtc 0.4.0) lib/ex_webrtc/peer_connection.ex:1560: ExWebRTC.PeerConnection.parse_sdp/1
    (ex_webrtc 0.4.0) lib/ex_webrtc/peer_connection.ex:1400: ExWebRTC.PeerConnection.apply_remote_description/2
    (ex_webrtc 0.4.0) lib/ex_webrtc/peer_connection.ex:650: ExWebRTC.PeerConnection.handle_call/3
Last message (from #PID<0.1889.0>): {:set_remote_description, %ExWebRTC.SessionDescription{type: :offer, sdp: "v=0\r\no=- 8997921153665821411 0 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=ice-options:trickle\r\na=group:BUNDLE video0 audio1\r\nm=video 9 UDP/TLS/RTP/SAVPF 96\r\nc=IN IP4 0.0.0.0\r\na=setup:actpass\r\na=ice-ufrag:bzlfqm6/vblska6CMDh4gYbyib/dCNGd\r\na=ice-pwd:txT29m+eAgy/czZOjWgXzbz8WyU0IZdX\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=sendrecv\r\na=rtpmap:96 VP8/90000\r\na=rtcp-fb:96 nack pli\r\na=rtcp-fb:96 transport-cc\r\na=framerate:30\r\na=ssrc:2 msid:user558725149@host-a208fcce webrtctransceiver0\r\na=ssrc:2 cname:user558725149@host-a208fcce\r\na=mid:video0\r\na=fingerprint:sha-256 C2:56:EA:3E:E2:7A:0C:08:8F:FC:45:92:BF:44:09:88:96:7C:FE:77:90:A1:52:F4:F7:EE:E5:32:FC:C6:DE:54\r\na=rtcp-mux-only\r\nm=audio 0 UDP/TLS/RTP/SAVPF 100\r\nc=IN IP4 0.0.0.0\r\na=setup:actpass\r\na=ice-ufrag:bzlfqm6/vblska6CMDh4gYbyib/dCNGd\r\na=ice-pwd:txT29m+eAgy/czZOjWgXzbz8WyU0IZdX\r\na=bundle-only\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=sendrecv\r\na=rtpmap:100 OPUS/48000/2\r\na=rtcp-fb:100 transport-cc\r\na=fmtp:100 sprop-stereo=0;sprop-maxcapturerate=48000\r\na=ssrc:1 msid:user558725149@host-a208fcce webrtctransceiver1\r\na=ssrc:1 cname:user558725149@host-a208fcce\r\na=mid:audio1\r\na=fingerprint:sha-256 C2:56:EA:3E:E2:7A:0C:08:8F:FC:45:92:BF:44:09:88:96:7C:FE:77:90:A1:52:F4:F7:EE:E5:32:FC:C6:DE:54\r\na=rtcp-mux-only\r\n"}}
16:05:25.267 request_id=F_Q1oYhecVLFojIAAD8C [error] GenServer #PID<0.1889.0> terminating
** (stop) exited in: GenServer.call(#PID<0.1890.0>, {:set_remote_description, %ExWebRTC.SessionDescription{type: :offer, sdp: "v=0\r\no=- 8997921153665821411 0 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=ice-options:trickle\r\na=group:BUNDLE video0 audio1\r\nm=video 9 UDP/TLS/RTP/SAVPF 96\r\nc=IN IP4 0.0.0.0\r\na=setup:actpass\r\na=ice-ufrag:bzlfqm6/vblska6CMDh4gYbyib/dCNGd\r\na=ice-pwd:txT29m+eAgy/czZOjWgXzbz8WyU0IZdX\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=sendrecv\r\na=rtpmap:96 VP8/90000\r\na=rtcp-fb:96 nack pli\r\na=rtcp-fb:96 transport-cc\r\na=framerate:30\r\na=ssrc:2 msid:user558725149@host-a208fcce webrtctransceiver0\r\na=ssrc:2 cname:user558725149@host-a208fcce\r\na=mid:video0\r\na=fingerprint:sha-256 C2:56:EA:3E:E2:7A:0C:08:8F:FC:45:92:BF:44:09:88:96:7C:FE:77:90:A1:52:F4:F7:EE:E5:32:FC:C6:DE:54\r\na=rtcp-mux-only\r\nm=audio 0 UDP/TLS/RTP/SAVPF 100\r\nc=IN IP4 0.0.0.0\r\na=setup:actpass\r\na=ice-ufrag:bzlfqm6/vblska6CMDh4gYbyib/dCNGd\r\na=ice-pwd:txT29m+eAgy/czZOjWgXzbz8WyU0IZdX\r\na=bundle-only\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=sendrecv\r\na=rtpmap:100 OPUS/48000/2\r\na=rtcp-fb:100 transport-cc\r\na=fmtp:100 sprop-stereo=0;sprop-maxcapturerate=48000\r\na=ssrc:1 msid:user558725149@host-a208fcce webrtctransceiver1\r\na=ssrc:1 cname:user558725149@host-a208fcce\r\na=mid:audio1\r\na=fingerprint:sha-256 C2:56:EA:3E:E2:7A:0C:08:8F:FC:45:92:BF:44:09:88:96:7C:FE:77:90:A1:52:F4:F7:EE:E5:32:FC:C6:DE:54\r\na=rtcp-mux-only\r\n"}}, 5000)

@sgfn sgfn requested a review from mat-hek September 19, 2024 16:17
@sgfn sgfn changed the title Fix parsing integer framerate Fix parsing integer framerate. Release 1.0.1 Sep 19, 2024
@sgfn sgfn merged commit 99349b9 into master Sep 19, 2024
3 checks passed
@sgfn sgfn deleted the fix/raise-on-integer-framerate branch September 19, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants