From 2dcb21a95d67c7d1027344abefff57b0fdaa4e33 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Sat, 26 May 2012 00:18:01 +0300 Subject: rtpenc: Expose the ssrc as an avoption MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows the caller to set it, and allows the caller to query what it was set to. Signed-off-by: Martin Storsjö --- libavformat/rtpenc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libavformat/rtpenc.c') diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c index 29fc2f4aa7..71eeb7e32f 100644 --- a/libavformat/rtpenc.c +++ b/libavformat/rtpenc.c @@ -33,6 +33,7 @@ static const AVOption options[] = { FF_RTP_FLAG_OPTS(RTPMuxContext, flags) { "payload_type", "Specify RTP payload type", offsetof(RTPMuxContext, payload_type), AV_OPT_TYPE_INT, {.dbl = -1 }, -1, 127, AV_OPT_FLAG_ENCODING_PARAM }, + { "ssrc", "Stream identifier", offsetof(RTPMuxContext, ssrc), AV_OPT_TYPE_INT, { 0 }, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM }, { NULL }, }; @@ -101,7 +102,8 @@ static int rtp_write_header(AVFormatContext *s1) s->base_timestamp = av_get_random_seed(); s->timestamp = s->base_timestamp; s->cur_timestamp = 0; - s->ssrc = av_get_random_seed(); + if (!s->ssrc) + s->ssrc = av_get_random_seed(); s->first_packet = 1; s->first_rtcp_ntp_time = ff_ntp_time(); if (s1->start_time_realtime) -- cgit v1.2.3