Commit 01be7907 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

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.
parent 97cc1b9c
......@@ -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;
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