Skip to content

Commit

Permalink
Merge commit 'bc2a32969eb4db17677971def5ad5b936d9d1648'
Browse files Browse the repository at this point in the history
* commit 'bc2a32969eb4db17677971def5ad5b936d9d1648':
  rtsp: Parse SSRC attributes in the SDP

Merged-by: Clément Bœsch <u@pkh.me>
  • Loading branch information
ubitux committed Jun 21, 2016
2 parents 4873952 + bc2a329 commit 00e122b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libavformat/rtsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,10 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
s1->seen_fmtp = 1;
av_strlcpy(s1->delayed_fmtp, buf, sizeof(s1->delayed_fmtp));
}
} else if (av_strstart(p, "ssrc:", &p) && s->nb_streams > 0) {
rtsp_st = rt->rtsp_streams[rt->nb_rtsp_streams - 1];
get_word(buf1, sizeof(buf1), &p);
rtsp_st->ssrc = strtoll(buf1, NULL, 10);
} else if (av_strstart(p, "range:", &p)) {
int64_t start, end;

Expand Down Expand Up @@ -831,6 +835,8 @@ int ff_rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
if (!rtsp_st->transport_priv) {
return AVERROR(ENOMEM);
} else if (CONFIG_RTPDEC && rt->transport == RTSP_TRANSPORT_RTP) {
RTPDemuxContext *rtpctx = rtsp_st->transport_priv;
rtpctx->ssrc = rtsp_st->ssrc;
if (rtsp_st->dynamic_handler) {
ff_rtp_parse_set_dynamic_protocol(rtsp_st->transport_priv,
rtsp_st->dynamic_protocol_context,
Expand Down
3 changes: 3 additions & 0 deletions libavformat/rtsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,9 @@ typedef struct RTSPStream {
/** Enable sending RTCP feedback messages according to RFC 4585 */
int feedback;

/** SSRC for this stream, to allow identifying RTCP packets before the first RTP packet */
uint32_t ssrc;

char crypto_suite[40];
char crypto_params[100];
} RTSPStream;
Expand Down

0 comments on commit 00e122b

Please sign in to comment.