summaryrefslogtreecommitdiff
path: root/libavformat/rtp.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2012-11-11 20:44:28 +0100
committerLuca Barbato <lu_zero@gentoo.org>2012-11-14 20:38:51 +0100
commit8034130e06b03859af9ce64f7ee653cd14df328d (patch)
treeac5d06c32f27347f96c147599f2e6129178c6e1e /libavformat/rtp.c
parent3b4296f41473a5b39e84d7a49d480624c9c60040 (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/rtp.c')
-rw-r--r--libavformat/rtp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/rtp.c b/libavformat/rtp.c
index 4314c4631c..651220692c 100644
--- a/libavformat/rtp.c
+++ b/libavformat/rtp.c
@@ -90,7 +90,8 @@ int ff_rtp_get_codec_info(AVCodecContext *codec, int payload_type)
return -1;
}
-int ff_rtp_get_payload_type(AVFormatContext *fmt, AVCodecContext *codec)
+int ff_rtp_get_payload_type(AVFormatContext *fmt,
+ AVCodecContext *codec, int idx)
{
int i;
AVOutputFormat *ofmt = fmt ? fmt->oformat : NULL;
@@ -124,8 +125,11 @@ int ff_rtp_get_payload_type(AVFormatContext *fmt, AVCodecContext *codec)
return AVRtpPayloadTypes[i].pt;
}
+ if (idx < 0)
+ idx = codec->codec_type == AVMEDIA_TYPE_AUDIO;
+
/* dynamic payload type */
- return RTP_PT_PRIVATE + (codec->codec_type == AVMEDIA_TYPE_AUDIO);
+ return RTP_PT_PRIVATE + idx;
}
const char *ff_rtp_enc_name(int payload_type)