mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
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
This commit is contained in:
parent
0489f5eb78
commit
2d458ca951
1 changed files with 9 additions and 4 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue