diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2012-11-11 23:44:28 +0400 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2012-11-14 23:38:51 +0400 |
commit | 8034130e06b03859af9ce64f7ee653cd14df328d (patch) | |
tree | ac5d06c32f27347f96c147599f2e6129178c6e1e /libavformat/rtpenc.c | |
parent | 3b4296f41473a5b39e84d7a49d480624c9c60040 (diff) |
rtp: set the payload type as stream id
Support multiple video/audio streams with different format in the
same session.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavformat/rtpenc.c')
-rw-r--r-- | libavformat/rtpenc.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c index b17c4651b6..babb2bb45f 100644 --- a/libavformat/rtpenc.c +++ b/libavformat/rtpenc.c @@ -101,8 +101,17 @@ static int rtp_write_header(AVFormatContext *s1) return -1; } - if (s->payload_type < 0) - s->payload_type = ff_rtp_get_payload_type(s1, st->codec); + if (s->payload_type < 0) { + /* Re-validate non-dynamic payload types */ + if (st->id < RTP_PT_PRIVATE) + st->id = ff_rtp_get_payload_type(s1, st->codec, -1); + + s->payload_type = st->id; + } else { + /* private option takes priority */ + st->id = s->payload_type; + } + s->base_timestamp = av_get_random_seed(); s->timestamp = s->base_timestamp; s->cur_timestamp = 0; |