aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtp.c
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@savoirfairelinux.com>2011-09-23 15:47:56 -0400
committerLuca Barbato <lu_zero@gentoo.org>2011-09-23 22:00:24 +0200
commit0c378ea1f76e226eff460c84634e7227e3705372 (patch)
tree312898a1f9dccd4248e7156a30aeca45b5030f44 /libavformat/rtp.c
parentbafff1668c6bc4d1cb3b7e4b9dac85b8b52e4765 (diff)
downloadffmpeg-0c378ea1f76e226eff460c84634e7227e3705372.tar.gz
rtp: factorize dynamic payload type fallback
Move the identical code in rtp_write_header() and ff_sdp_write_media() inside ff_rtp_get_payload_type() Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavformat/rtp.c')
-rw-r--r--libavformat/rtp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/rtp.c b/libavformat/rtp.c
index d59b6941b6..35edb5066a 100644
--- a/libavformat/rtp.c
+++ b/libavformat/rtp.c
@@ -103,6 +103,11 @@ int ff_rtp_get_payload_type(AVCodecContext *codec)
continue;
payload_type = AVRtpPayloadTypes[i].pt;
}
+
+ /* dynamic payload type */
+ if (payload_type < 0)
+ payload_type = RTP_PT_PRIVATE + (codec->codec_type == AVMEDIA_TYPE_AUDIO);
+
return payload_type;
}