summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2015-05-04 18:17:21 +1000
committerJan Schmidt <jan@centricular.com>2015-05-30 01:33:49 +1000
commit6dabd46a2d8ec341113cb3b257bd6548442a1ea5 (patch)
tree4e5c953c28b2ec074d64ace9b41be6bc13474767 /gst-libs
parentfba7c97135ee8279ebf16f31faef7ca320252867 (diff)
downloadgstreamer-plugins-bad-6dabd46a2d8ec341113cb3b257bd6548442a1ea5.tar.gz
videoaggregator: Catch errors, and allow sub-class to return NULL from get_output_buffer()
A return value of GST_FLOW_OK with a NULL buffer from get_output_buffer() means the sub-class doesn't want to produce an output buffer, so skip it. If gst_videoaggregator_do_aggregate() generates an error, make sure to propagate it - don't just ignore and discard the error by over-writing it with the gst_pad_push() result.
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/video/gstvideoaggregator.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gst-libs/gst/video/gstvideoaggregator.c b/gst-libs/gst/video/gstvideoaggregator.c
index d31690fcf..2f720f382 100644
--- a/gst-libs/gst/video/gstvideoaggregator.c
+++ b/gst-libs/gst/video/gstvideoaggregator.c
@@ -1198,6 +1198,10 @@ gst_videoaggregator_do_aggregate (GstVideoAggregator * vagg,
gst_flow_get_name (ret));
return ret;
}
+ if (*outbuf == NULL) {
+ /* sub-class doesn't want to generate output right now */
+ return GST_FLOW_OK;
+ }
GST_BUFFER_TIMESTAMP (*outbuf) = output_start_time;
GST_BUFFER_DURATION (*outbuf) = output_end_time - output_start_time;
@@ -1369,6 +1373,8 @@ gst_videoaggregator_aggregate (GstAggregator * agg, gboolean timeout)
if (jitter <= 0) {
ret = gst_videoaggregator_do_aggregate (vagg, output_start_time,
output_end_time, &outbuf);
+ if (ret != GST_FLOW_OK)
+ goto done;
vagg->priv->qos_processed++;
} else {
GstMessage *msg;
@@ -1405,6 +1411,8 @@ gst_videoaggregator_aggregate (GstAggregator * agg, gboolean timeout)
goto done_unlocked;
done:
+ if (outbuf)
+ gst_buffer_unref (outbuf);
GST_VIDEO_AGGREGATOR_UNLOCK (vagg);
done_unlocked: