aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtpenc_chain.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-15 11:31:13 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-15 11:31:13 +0100
commita9b1536a018b867e3458a278c2992f7cd2fb707d (patch)
tree55556d53044f7e8854f59c9eb7fcab76f3ea19d1 /libavformat/rtpenc_chain.c
parent4d941eac1655b21af33c6e4d52b7bfd7f9e5b990 (diff)
parentb74dbdd5e99aed7f3bf1ecb5da1b374e5ba35768 (diff)
downloadffmpeg-a9b1536a018b867e3458a278c2992f7cd2fb707d.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: bgmc: Fix av_malloc checks in ff_bgmc_init() rtp: set the payload type as stream id Conflicts: libavformat/rtpenc_chain.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtpenc_chain.c')
-rw-r--r--libavformat/rtpenc_chain.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/libavformat/rtpenc_chain.c b/libavformat/rtpenc_chain.c
index c0f9530ac8..25b0b8b333 100644
--- a/libavformat/rtpenc_chain.c
+++ b/libavformat/rtpenc_chain.c
@@ -23,13 +23,15 @@
#include "avio_internal.h"
#include "rtpenc_chain.h"
#include "avio_internal.h"
+#include "rtp.h"
#include "libavutil/opt.h"
int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s,
- AVStream *st, URLContext *handle, int packet_size)
+ AVStream *st, URLContext *handle, int packet_size,
+ int idx)
{
AVFormatContext *rtpctx = NULL;
- int ret;
+ int ret, pt;
AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
uint8_t *rtpflags;
AVDictionary *opts = NULL;
@@ -59,6 +61,14 @@ int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s,
rtpctx->streams[0]->sample_aspect_ratio = st->sample_aspect_ratio;
rtpctx->flags |= s->flags & AVFMT_FLAG_MP4A_LATM;
+ /* Get the payload type from the codec */
+ if (st->id < RTP_PT_PRIVATE)
+ rtpctx->streams[0]->id =
+ ff_rtp_get_payload_type(rtpctx, st->codec, idx);
+ else
+ rtpctx->streams[0]->id = st->id;
+
+
if (av_opt_get(s, "rtpflags", AV_OPT_SEARCH_CHILDREN, &rtpflags) >= 0)
av_dict_set(&opts, "rtpflags", rtpflags, AV_DICT_DONT_STRDUP_VAL);