Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR Summary by QodoRestore RTCP sender-report intervals for interleaved RTSP tracks
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can enable the Remediation agent and Qodo fixes findings in a dedicated fix PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
A client that plays over RTSP/TCP ("interleaved" transport) gets an RTCP sender report with every RTP packet instead of one every 150 packets. Players that use the reports to line up audio and video (FFmpeg, and so everything built on it) then re-time every packet by the moment it was sent. On a Ruision F8 board (FH8856V200) with MP3 audio over TCP, the audio timestamps in an FFmpeg capture moved in steps of 40 and 80 ms instead of the steady frame length; over UDP they were steady.
Also, a client that sets up only one of the two tracks (for example video only) makes the report poll fail its postcondition once for the other track, which logs an assertion failure.
Why
__method_play()(src/rtsp/rtsp.c) setsrtcp_tick_org = 150andrtcp_tickonly for tracks that have a UDP server port (if (!p->trans[i].server_port_rtp) continue;). Interleaved tracks have no server port, so both stay 0.__rtcp_poll()(src/rtsp/rtp.c) sends a report when the tick reaches 0 and reloads it fromrtcp_tick_org, which is 0 again: a report with every packet.For a track that was never set up,
__rtcp_send_sr()returns early without reloading the tick, so the tick goes from 0 to -1 and theDASSERTafter it (rtcp_tick == rtcp_tick_org) fails.What this changes
__method_play(): for an interleaved track, clear the report counters and setrtcp_tick_org = 150withrtcp_tick = 0, so the first packet still brings a report at once and then one follows every 150 packets, as on UDP.__rtcp_poll(): skip a track that has neither a UDP port nor TCP transport, the same test__rtcp_send_sr()already makes.How it was checked
./build.sh fhan-v2, no new warnings;./test.sh -apasses.assertion failure ((__rtcp_poll)...)once; with the change, no assertion in two runs.Effect on other platforms
Shared RTSP code, used by every target. UDP clients: no change. TCP clients: one report every 150 packets per track instead of one per packet, which is what UDP clients already get, and less traffic.
🤖 Generated with Claude Code