diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-06-30 11:18:24 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-06-30 18:40:28 +0200 |
commit | c3bcbadd5452d5b3450f70e49dad3e64f14de00a (patch) | |
tree | 193dc4b335f830094604f5a53d247cc98d5bceac /libs | |
parent | 866f9ace5cbf245b67ec993ef69302f2ff715954 (diff) |
baseparse: Use new gst_adapter_get_buffer() API instead of gst_adapter_map()
This preserves GstMeta properly unless the subclass does special things. It's
enough to make h264parse's stream-format/alignment conversion pass through
metas as needed.
https://bugzilla.gnome.org/show_bug.cgi?id=742385
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gst/base/gstbaseparse.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index eee3c92f7..d49aad6b2 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -2813,7 +2813,6 @@ gst_base_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) GstBuffer *tmpbuf = NULL; guint fsize = 1; gint skip = -1; - const guint8 *data; guint min_size, av; GstClockTime pts, dts; @@ -3012,11 +3011,7 @@ gst_base_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) parse->priv->next_dts = pts; /* always pass all available data */ - data = gst_adapter_map (parse->priv->adapter, av); - /* arrange for actual data to be copied if subclass tries to, - * since what is passed is tied to the adapter */ - tmpbuf = gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY | - GST_MEMORY_FLAG_NO_SHARE, (gpointer) data, av, 0, av, NULL, NULL); + tmpbuf = gst_adapter_get_buffer (parse->priv->adapter, av); /* already inform subclass what timestamps we have planned, * at least if provided by time-based upstream */ @@ -3029,9 +3024,6 @@ gst_base_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) ret = gst_base_parse_handle_buffer (parse, tmpbuf, &skip, &flush); tmpbuf = NULL; - /* probably already implicitly unmapped due to adapter operation, - * but for good measure ... */ - gst_adapter_unmap (parse->priv->adapter); if (ret != GST_FLOW_OK && ret != GST_FLOW_NOT_LINKED) { goto done; } |