Commit 2d458ca9 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠
Browse files

audio encoders: use context default bitrate if no bitrate has been set

Fixes 'bitrate too low: got 0, need 24000 or higher'
error when doing audiotstsrc ! avenc_wmav1 ! fakesink

https://bugzilla.gnome.org/show_bug.cgi?id=680487

https://bugzilla.gnome.org/show_bug.cgi?id=680487
parent 0489f5eb
......@@ -261,10 +261,15 @@ gst_ffmpegaudenc_setcaps (GstFFMpegAudEnc * ffmpegaudenc, GstCaps * caps)
ffmpegaudenc->context->strict_std_compliance = -1;
/* user defined properties */
ffmpegaudenc->context->bit_rate = ffmpegaudenc->bitrate;
ffmpegaudenc->context->bit_rate_tolerance = ffmpegaudenc->bitrate;
GST_DEBUG_OBJECT (ffmpegaudenc, "Setting avcontext to bitrate %d",
ffmpegaudenc->bitrate);
if (ffmpegaudenc->bitrate > 0) {
GST_INFO_OBJECT (ffmpegaudenc, "Setting avcontext to bitrate %d",
ffmpegaudenc->bitrate);
ffmpegaudenc->context->bit_rate = ffmpegaudenc->bitrate;
ffmpegaudenc->context->bit_rate_tolerance = ffmpegaudenc->bitrate;
} else {
GST_INFO_OBJECT (ffmpegaudenc, "Using avcontext default bitrate %d",
ffmpegaudenc->context->bit_rate);
}
/* RTP payload used for GOB production (for Asterisk) */
if (ffmpegaudenc->rtp_payload_size) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment