Skip to content

Commit

Permalink
Pop processed buffers only
Browse files Browse the repository at this point in the history
  • Loading branch information
m-herrera committed Nov 30, 2021
1 parent 49323f7 commit a2f02a7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gst-libs/gst/tiovx/gsttiovxmiso.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ gst_tiovx_miso_aggregate (GstAggregator * agg, gboolean timeout)
GstClockTime duration = 0;
gboolean all_pads_eos = TRUE;
gboolean eos = FALSE;
GList *processed_pads = NULL;

GST_DEBUG_OBJECT (self, "TIOVX Miso aggregate");

Expand Down Expand Up @@ -567,6 +568,7 @@ gst_tiovx_miso_aggregate (GstAggregator * agg, gboolean timeout)

in_buffer = gst_aggregator_pad_peek_buffer (pad);
if (in_buffer) {
processed_pads = g_list_append (processed_pads, pad);
tmp_pts = GST_BUFFER_PTS (in_buffer);
tmp_dts = GST_BUFFER_DTS (in_buffer);
tmp_duration = GST_BUFFER_DURATION (in_buffer);
Expand Down Expand Up @@ -601,6 +603,7 @@ gst_tiovx_miso_aggregate (GstAggregator * agg, gboolean timeout)

if (all_pads_eos || eos) {
ret = GST_FLOW_EOS;
processed_pads = GST_ELEMENT (agg)->sinkpads;
goto finish_buffer;
}

Expand Down Expand Up @@ -628,8 +631,8 @@ gst_tiovx_miso_aggregate (GstAggregator * agg, gboolean timeout)
}
gst_aggregator_finish_buffer (agg, outbuf);

/* Mark all input buffers as read */
for (l = GST_ELEMENT (agg)->sinkpads; l; l = g_list_next (l)) {
/* Mark all processed buffers as read */
for (l = processed_pads; l; l = g_list_next (l)) {
GstAggregatorPad *pad = l->data;
GstBuffer *in_buffer = NULL;

Expand All @@ -638,6 +641,7 @@ gst_tiovx_miso_aggregate (GstAggregator * agg, gboolean timeout)
gst_buffer_unref (in_buffer);
}
}
g_list_free (processed_pads);

exit:

Expand Down

0 comments on commit a2f02a7

Please sign in to comment.