From 92ab6531733c2e8812dd5e2a25762aa614acb3e4 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 13 Aug 2024 16:02:32 +0200 Subject: [PATCH] rxtx/sdp: direct play url again print Since the rtpmap line is now generated also for static packet types, the condition must have been updated to check the packet type rather than the presence of rtpmap line. --- src/utils/sdp.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/utils/sdp.c b/src/utils/sdp.c index 31992ba73..24d3a88a3 100644 --- a/src/utils/sdp.c +++ b/src/utils/sdp.c @@ -490,18 +490,19 @@ static void print_std_rtp_urls(struct sdp *sdp, bool ipv6) { const char *const bind_addr = ipv6 ? "[::]" : "0.0.0.0"; int port = 0; - if (sdp->audio_index >= 0 && - sdp->stream[sdp->audio_index].rtpmap[0] == '\0') { - if (sscanf(sdp_state->stream[sdp->audio_index].media_info, "%*[^ ] %d", - &port) == 1) { + int pt = 0; + if (sdp->audio_index >= 0) { + if (sscanf(sdp_state->stream[sdp->audio_index].media_info, + "%*[^ ] %d RTP/AVP %d", &port, &pt) == 2 && + pt < PT_DynRTP_Type96) { MSG(NOTICE, "audio can be played directly with rtp://%s:%d\n", bind_addr, port); } } - if (sdp->video_index >= 0 && - sdp->stream[sdp->video_index].rtpmap[0] == '\0') { - if (sscanf(sdp_state->stream[sdp->video_index].media_info, "%*[^ ] %d", - &port) == 1) { + if (sdp->video_index >= 0) { + if (sscanf(sdp_state->stream[sdp->video_index].media_info, + "%*[^ ] %d RTP/AVP %d", &port, &pt) == 2 && + pt < PT_DynRTP_Type96) { MSG(NOTICE, "video can be played directly with rtp://%s:%d\n", bind_addr, port); }