diff options
author | Dmitry Samonenko <shreddingwork@gmail.com> | 2012-10-13 19:03:33 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-13 18:47:18 +0200 |
commit | 083c7bf70131a70bc9a23b4daccd9e688a6c0854 (patch) | |
tree | 01ec3acd04a0102d1441e8c26b968891c4234aee /libavformat/sdp.c | |
parent | c45b829d52589b5d40c20cf5665886c664b9e2de (diff) | |
download | ffmpeg-083c7bf70131a70bc9a23b4daccd9e688a6c0854.tar.gz |
sdp: output speex optional vbr parameter
Optional sdp speex payload parameter is outputed only when
data is encoded. It's not printed in case of stream copy.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/sdp.c')
-rw-r--r-- | libavformat/sdp.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libavformat/sdp.c b/libavformat/sdp.c index ca8c3dfdb7..c4edd783be 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -575,6 +575,20 @@ static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c, case AV_CODEC_ID_SPEEX: av_strlcatf(buff, size, "a=rtpmap:%d speex/%d\r\n", payload_type, c->sample_rate); + if (c->codec) { + const char *mode; + uint64_t vad_option; + + if (c->flags & CODEC_FLAG_QSCALE) + mode = "on"; + else if (!av_opt_get_int(c, "vad", AV_OPT_FLAG_ENCODING_PARAM, &vad_option) && vad_option) + mode = "vad"; + else + mode = "off"; + + av_strlcatf(buff, size, "a=fmtp:%d vbr=%s\r\n", + payload_type, mode); + } break; case AV_CODEC_ID_OPUS: av_strlcatf(buff, size, "a=rtpmap:%d opus/48000\r\n", |