Skip to content
Snippets Groups Projects
Commit 6c8f0514 authored by Yun-Jing Huang's avatar Yun-Jing Huang
Browse files

bug fix: fix missing output before gaps

parent 6ab7d07c
No related branches found
No related tags found
1 merge request!536bug fix: fix missing output before gaps
Pipeline #562784 passed with warnings
......@@ -831,6 +831,7 @@ static GstFlowReturn transform(GstBaseTransform *trans, GstBuffer *inbuf, GstBuf
guint output_length;
GstFlowReturn result = GST_FLOW_OK;
gboolean copied_nongap;
gboolean copied_nongap_all = FALSE;
GstMapInfo mapinfo;
g_assert(GST_BUFFER_PTS_IS_VALID(inbuf));
......@@ -915,6 +916,9 @@ static GstFlowReturn transform(GstBaseTransform *trans, GstBuffer *inbuf, GstBuf
else
gst_audioadapter_copy_samples(element->adapter, element->workspace32->data, element->blocksampsin, NULL, &copied_nongap);
if (copied_nongap)
copied_nongap_all = TRUE;
if (element->outrate > element->inrate)
upsample32(output, element->kernel32, element->workspace32->data, kernel_length(element), element->outrate / element->inrate, element->channels, element->blockstrideout, copied_nongap);
else
......@@ -934,7 +938,7 @@ static GstFlowReturn transform(GstBaseTransform *trans, GstBuffer *inbuf, GstBuf
processed += element->blockstrideout;
}
GST_INFO_OBJECT(element, "Processed a %d samples", processed);
set_metadata(element, outbuf, output_length, !copied_nongap);
set_metadata(element, outbuf, output_length, !copied_nongap_all);
gst_buffer_unmap(outbuf, &mapinfo);
}
if (element->width == 64) {
......@@ -962,6 +966,9 @@ static GstFlowReturn transform(GstBaseTransform *trans, GstBuffer *inbuf, GstBuf
else
gst_audioadapter_copy_samples(element->adapter, element->workspace64->data, element->blocksampsin, NULL, &copied_nongap);
if (copied_nongap)
copied_nongap_all = TRUE;
if (element->outrate > element->inrate)
upsample64(output, element->kernel64, element->workspace64->data, kernel_length(element), element->outrate / element->inrate, element->channels, element->blockstrideout, copied_nongap);
else
......@@ -981,7 +988,7 @@ static GstFlowReturn transform(GstBaseTransform *trans, GstBuffer *inbuf, GstBuf
processed += element->blockstrideout;
}
GST_INFO_OBJECT(element, "Processed a %d samples", processed);
set_metadata(element, outbuf, output_length, !copied_nongap);
set_metadata(element, outbuf, output_length, !copied_nongap_all);
gst_buffer_unmap(outbuf, &mapinfo);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment