Skip to content

Commit

Permalink
video: stream enable/disable for re-INVITE/UPDATE
Browse files Browse the repository at this point in the history
  • Loading branch information
cspiel1 authored and sreimers committed Apr 9, 2024
1 parent 73f45c1 commit 63570f5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1275,9 +1275,8 @@ int video_update(struct video *v, const char *peer)

if (!sc) {
info("video: video stream is disabled..\n");
video_stop_source(v);
video_stop_display(v);
return err;
video_stop(v);
return 0;
}

if (dir & SDP_SENDONLY)
Expand All @@ -1287,10 +1286,14 @@ int video_update(struct video *v, const char *peer)
err |= video_decoder_set(v, sc->data, sc->pt, sc->rparams);

/* Stop / Start source & display*/
if (dir & SDP_SENDONLY)
if (dir & SDP_SENDONLY) {
err |= video_start_source(v);
else
stream_enable_tx(v->strm, true);
}
else {
stream_enable_tx(v->strm, false);
video_stop_source(v);
}

if (dir == SDP_RECVONLY)
stream_open_natpinhole(v->strm);
Expand All @@ -1299,8 +1302,10 @@ int video_update(struct video *v, const char *peer)

if (dir & SDP_RECVONLY) {
err |= video_start_display(v, peer);
stream_enable_rx(v->strm, true);
}
else {
stream_enable_rx(v->strm, false);
video_stop_display(v);
}

Expand Down

0 comments on commit 63570f5

Please sign in to comment.