Skip to content

Commit

Permalink
audio,stream: video only call if no common audio codecs (#3037)
Browse files Browse the repository at this point in the history
Fixes call termination if there are no common audio codecs, but video is
possible. In this case now the audio stream is stopped and the call proceeds
with the video stream. In bound DTMF is not possible.
  • Loading branch information
cspiel1 committed May 23, 2024
1 parent 49eafdc commit 699441f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@ int audio_update(struct audio *a)
sc = sdp_media_rformat(m, NULL);
}

if (!sc) {
if (!sc || !sc->data) {
info("audio: stream is disabled\n");
audio_stop(a);
return 0;
Expand Down
12 changes: 11 additions & 1 deletion src/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -1070,10 +1070,20 @@ void stream_flush(struct stream *s)

void stream_enable_rtp_timeout(struct stream *strm, uint32_t timeout_ms)
{
struct sdp_media *m;

if (!strm)
return;

if (!sdp_media_has_media(stream_sdpmedia(strm)))
m = stream_sdpmedia(strm);
if (!sdp_media_has_media(m))
return;

if (sdp_media_disabled(m))
return;

const struct sdp_format *sc = sdp_media_rformat(m, NULL);
if (!sc || !sc->data)
return;

strm->rxm.rtp_timeout = timeout_ms;
Expand Down

0 comments on commit 699441f

Please sign in to comment.