mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
fdkaacenc: Fix draining with libfdk-aac v2.0.0
This release requires all buffer descriptor pointers to be valid, even when we provide zero input buffers.
This commit is contained in:
parent
b7f95d64f8
commit
3bc9bd2b99
1 changed files with 13 additions and 8 deletions
|
@ -543,9 +543,7 @@ gst_fdkaacenc_handle_frame (GstAudioEncoder * enc, GstBuffer * inbuf)
|
||||||
|
|
||||||
info = gst_audio_encoder_get_audio_info (enc);
|
info = gst_audio_encoder_get_audio_info (enc);
|
||||||
|
|
||||||
if (!inbuf) {
|
if (inbuf) {
|
||||||
in_args.numInSamples = -1;
|
|
||||||
} else {
|
|
||||||
if (self->need_reorder) {
|
if (self->need_reorder) {
|
||||||
inbuf = gst_buffer_copy (inbuf);
|
inbuf = gst_buffer_copy (inbuf);
|
||||||
gst_buffer_map (inbuf, &imap, GST_MAP_READWRITE);
|
gst_buffer_map (inbuf, &imap, GST_MAP_READWRITE);
|
||||||
|
@ -559,14 +557,21 @@ gst_fdkaacenc_handle_frame (GstAudioEncoder * enc, GstBuffer * inbuf)
|
||||||
in_args.numInSamples = imap.size / GST_AUDIO_INFO_BPS (info);
|
in_args.numInSamples = imap.size / GST_AUDIO_INFO_BPS (info);
|
||||||
|
|
||||||
in_sizes = imap.size;
|
in_sizes = imap.size;
|
||||||
in_el_sizes = 2;
|
in_el_sizes = GST_AUDIO_INFO_BPS (info);
|
||||||
in_desc.bufferIdentifiers = &in_id;
|
|
||||||
in_desc.numBufs = 1;
|
in_desc.numBufs = 1;
|
||||||
in_desc.bufs = (void *) &imap.data;
|
} else {
|
||||||
in_desc.bufSizes = &in_sizes;
|
in_args.numInSamples = -1;
|
||||||
in_desc.bufElSizes = &in_el_sizes;
|
|
||||||
|
in_sizes = 0;
|
||||||
|
in_el_sizes = 0;
|
||||||
|
in_desc.numBufs = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
in_desc.bufferIdentifiers = &in_id;
|
||||||
|
in_desc.bufs = (void *) &imap.data;
|
||||||
|
in_desc.bufSizes = &in_sizes;
|
||||||
|
in_desc.bufElSizes = &in_el_sizes;
|
||||||
|
|
||||||
outbuf = gst_audio_encoder_allocate_output_buffer (enc, self->outbuf_size);
|
outbuf = gst_audio_encoder_allocate_output_buffer (enc, self->outbuf_size);
|
||||||
if (!outbuf) {
|
if (!outbuf) {
|
||||||
ret = GST_FLOW_ERROR;
|
ret = GST_FLOW_ERROR;
|
||||||
|
|
Loading…
Reference in a new issue