summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Alexander Steffens (heftig) <jsteffens@make.tv>2019-02-13 16:09:45 +0100
committerJan Alexander Steffens (heftig) <jsteffens@make.tv>2019-02-13 16:12:03 +0100
commit3bc9bd2b99797cef15c79d63dea5cd262756ed97 (patch)
tree086e32afbfe976c5608c56f615317dc03f0e9a17
parentb7f95d64f87229856b1c26d2622fa8c103b290f6 (diff)
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.
-rw-r--r--ext/fdkaac/gstfdkaacenc.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/ext/fdkaac/gstfdkaacenc.c b/ext/fdkaac/gstfdkaacenc.c
index 532e88c73..93ff780f1 100644
--- a/ext/fdkaac/gstfdkaacenc.c
+++ b/ext/fdkaac/gstfdkaacenc.c
@@ -543,9 +543,7 @@ gst_fdkaacenc_handle_frame (GstAudioEncoder * enc, GstBuffer * inbuf)
info = gst_audio_encoder_get_audio_info (enc);
- if (!inbuf) {
- in_args.numInSamples = -1;
- } else {
+ if (inbuf) {
if (self->need_reorder) {
inbuf = gst_buffer_copy (inbuf);
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_sizes = imap.size;
- in_el_sizes = 2;
- in_desc.bufferIdentifiers = &in_id;
+ in_el_sizes = GST_AUDIO_INFO_BPS (info);
in_desc.numBufs = 1;
- in_desc.bufs = (void *) &imap.data;
- in_desc.bufSizes = &in_sizes;
- in_desc.bufElSizes = &in_el_sizes;
+ } else {
+ in_args.numInSamples = -1;
+
+ 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);
if (!outbuf) {
ret = GST_FLOW_ERROR;