mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-22 15:18:21 +00:00
avaudenc: Set all required fields in the AVFrame
Various functions in libavcodec need them, like the format, sample rate, etc. and just having them in the context is not enough. This fixes draining for codecs like MP2 that require a fixed frame size and require libav to pad the last frame if required.
This commit is contained in:
parent
2027188c34
commit
151cd32a10
1 changed files with 4 additions and 0 deletions
|
@ -475,6 +475,10 @@ gst_ffmpegaudenc_encode_audio (GstFFMpegAudEnc * ffmpegaudenc,
|
|||
|
||||
info = gst_audio_encoder_get_audio_info (enc);
|
||||
planar = av_sample_fmt_is_planar (ffmpegaudenc->context->sample_fmt);
|
||||
frame->format = ffmpegaudenc->context->sample_fmt;
|
||||
frame->sample_rate = ffmpegaudenc->context->sample_rate;
|
||||
frame->channels = ffmpegaudenc->context->channels;
|
||||
frame->channel_layout = ffmpegaudenc->context->channel_layout;
|
||||
|
||||
if (planar && info->channels > 1) {
|
||||
gint channels;
|
||||
|
|
Loading…
Reference in a new issue