diff options
author | Stefan Kost <ensonic@users.sf.net> | 2009-02-27 11:24:37 +0200 |
---|---|---|
committer | Stefan Kost <ensonic@users.sf.net> | 2009-02-27 12:27:14 +0200 |
commit | 5f2d5aa5a547427e5f564ab4b309cfc8f26fba18 (patch) | |
tree | 61aabd9fea182b250e0869238c1742d0c4d7d90e /gst/flacparse | |
parent | 3aecf7e2572dd43d450d1c21d65958680ede1f2b (diff) | |
download | gst-plugins-bad-5f2d5aa5a547427e5f564ab4b309cfc8f26fba18.tar.gz gst-plugins-bad-5f2d5aa5a547427e5f564ab4b309cfc8f26fba18.tar.bz2 gst-plugins-bad-5f2d5aa5a547427e5f564ab4b309cfc8f26fba18.zip |
baseparse: revert last change and properly fix
Baseparse internaly breaks the semantics of a _chain function by calling it with
buffer==NULL. The reson I belived it was okay to remove it was that there is
also an unchecked access to buffer later in _chain. Actually that code is wrong,
as it most probably wants to set discont on the outgoing buffer.
Diffstat (limited to 'gst/flacparse')
-rw-r--r-- | gst/flacparse/gstbaseparse.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gst/flacparse/gstbaseparse.c b/gst/flacparse/gstbaseparse.c index 5f35d917..ea06474e 100644 --- a/gst/flacparse/gstbaseparse.c +++ b/gst/flacparse/gstbaseparse.c @@ -989,9 +989,11 @@ gst_base_parse_chain (GstPad * pad, GstBuffer * buffer) gst_base_parse_update_upstream_durations (parse); - GST_LOG_OBJECT (parse, "buffer size: %d, offset = %lld", - GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (buffer)); - gst_adapter_push (parse->priv->adapter, buffer); + if (G_LIKELY (buffer)) { + GST_LOG_OBJECT (parse, "buffer size: %d, offset = %lld", + GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (buffer)); + gst_adapter_push (parse->priv->adapter, buffer); + } /* Parse and push as many frames as possible */ /* Stop either when adapter is empty or we are flushing */ @@ -1021,7 +1023,7 @@ gst_base_parse_chain (GstPad * pad, GstBuffer * buffer) if (parse->priv->discont) { GST_DEBUG_OBJECT (parse, "marking DISCONT"); - GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DISCONT); + GST_BUFFER_FLAG_SET (tmpbuf, GST_BUFFER_FLAG_DISCONT); } skip = -1; |