summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2015-03-14 16:12:45 +0000
committerThiago Santos <thiagoss@osg.samsung.com>2015-03-20 07:42:11 -0300
commitb98fc10591b4655bdd1b8aae0e82ad102ce22453 (patch)
tree4c85102e13217197c93f5a29d4e443ddf3e5a6f1
parent6a6188a82f671032bf1c9ce3dd66310075cf4197 (diff)
output-selector: add drain handling
Release the latest buffer, if any
-rw-r--r--plugins/elements/gstoutputselector.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/elements/gstoutputselector.c b/plugins/elements/gstoutputselector.c
index 8ad870c98..5d2e01d32 100644
--- a/plugins/elements/gstoutputselector.c
+++ b/plugins/elements/gstoutputselector.c
@@ -563,6 +563,15 @@ gst_output_selector_event (GstPad * pad, GstObject * parent, GstEvent * event)
return res;
}
+static void
+gst_output_selector_drain (GstOutputSelector * sel)
+{
+ if (sel->latest_buffer) {
+ gst_buffer_unref (sel->latest_buffer);
+ sel->latest_buffer = NULL;
+ }
+}
+
static gboolean
gst_output_selector_query (GstPad * pad, GstObject * parent, GstQuery * query)
{
@@ -595,9 +604,13 @@ gst_output_selector_query (GstPad * pad, GstObject * parent, GstQuery * query)
}
break;
}
+ case GST_QUERY_DRAIN:
+ gst_output_selector_drain (sel);
+ /* fall through */
default:
res = gst_pad_query_default (pad, parent, query);
break;
}
+
return res;
}