diff options
author | Rafaël Carré <rafael.carre@savoirfairelinux.com> | 2011-09-26 11:56:48 -0400 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2011-09-26 21:54:57 +0300 |
commit | 9152880e9503f193032304c65c78b297171c81ee (patch) | |
tree | b1f9392ffd369b55d3ac5346d9acf38bb9b019f5 /libavformat/rtpenc.c | |
parent | 142887741fceed6de63a64e21cfca1944c2be889 (diff) | |
download | ffmpeg-9152880e9503f193032304c65c78b297171c81ee.tar.gz |
rtpenc: Add a payload type private option
Specifying the payload type is useful when the type number has
already been negotiated before creating the stream, for example
in SIP protocol.
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtpenc.c')
-rw-r--r-- | libavformat/rtpenc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c index 1f5d9ba37a..ce42e3e9aa 100644 --- a/libavformat/rtpenc.c +++ b/libavformat/rtpenc.c @@ -32,6 +32,7 @@ static const AVOption options[] = { FF_RTP_FLAG_OPTS(RTPMuxContext, flags), + { "payload_type", "Specify RTP payload type", offsetof(RTPMuxContext, payload_type), FF_OPT_TYPE_INT, {.dbl = -1 }, -1, 127, AV_OPT_FLAG_ENCODING_PARAM }, { NULL }, }; @@ -92,7 +93,8 @@ static int rtp_write_header(AVFormatContext *s1) return -1; } - s->payload_type = ff_rtp_get_payload_type(st->codec); + if (s->payload_type < 0) + s->payload_type = ff_rtp_get_payload_type(s1, st->codec); s->base_timestamp = av_get_random_seed(); s->timestamp = s->base_timestamp; s->cur_timestamp = 0; |