diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-15 11:31:13 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-15 11:31:13 +0100 |
commit | a9b1536a018b867e3458a278c2992f7cd2fb707d (patch) | |
tree | 55556d53044f7e8854f59c9eb7fcab76f3ea19d1 /libavformat/sdp.c | |
parent | 4d941eac1655b21af33c6e4d52b7bfd7f9e5b990 (diff) | |
parent | b74dbdd5e99aed7f3bf1ecb5da1b374e5ba35768 (diff) | |
download | ffmpeg-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/sdp.c')
-rw-r--r-- | libavformat/sdp.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/libavformat/sdp.c b/libavformat/sdp.c index c4edd783be..cdc3e212ef 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -604,12 +604,15 @@ static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c, return buff; } -void ff_sdp_write_media(char *buff, int size, AVCodecContext *c, const char *dest_addr, const char *dest_type, int port, int ttl, AVFormatContext *fmt) +void ff_sdp_write_media(char *buff, int size, AVStream *st, int idx, + const char *dest_addr, const char *dest_type, + int port, int ttl, AVFormatContext *fmt) { + AVCodecContext *c = st->codec; const char *type; int payload_type; - payload_type = ff_rtp_get_payload_type(fmt, c); + payload_type = ff_rtp_get_payload_type(fmt, c, idx); switch (c->codec_type) { case AVMEDIA_TYPE_VIDEO : type = "video" ; break; @@ -631,7 +634,7 @@ int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size) { AVDictionaryEntry *title = av_dict_get(ac[0]->metadata, "title", NULL, 0); struct sdp_session_level s = { 0 }; - int i, j, port, ttl, is_multicast; + int i, j, port, ttl, is_multicast, index = 0; char dst[32], dst_type[5]; memset(buf, 0, size); @@ -670,10 +673,10 @@ int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size) ttl = 0; } for (j = 0; j < ac[i]->nb_streams; j++) { - ff_sdp_write_media(buf, size, - ac[i]->streams[j]->codec, dst[0] ? dst : NULL, - dst_type, (port > 0) ? port + j * 2 : 0, ttl, - ac[i]); + ff_sdp_write_media(buf, size, ac[i]->streams[j], index++, + dst[0] ? dst : NULL, dst_type, + (port > 0) ? port + j * 2 : 0, + ttl, ac[i]); if (port <= 0) { av_strlcatf(buf, size, "a=control:streamid=%d\r\n", i + j); @@ -689,7 +692,9 @@ int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size) return AVERROR(ENOSYS); } -void ff_sdp_write_media(char *buff, int size, AVCodecContext *c, const char *dest_addr, const char *dest_type, int port, int ttl, AVFormatContext *fmt) +void ff_sdp_write_media(char *buff, int size, AVStream *st, int idx, + const char *dest_addr, const char *dest_type, + int port, int ttl, AVFormatContext *fmt) { } #endif |