diff options
author | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2009-08-07 13:07:17 +0200 |
---|---|---|
committer | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2009-08-07 13:09:24 +0200 |
commit | 222322e7f372397c18a9bd092be1ba8581586799 (patch) | |
tree | f53d0d021381ed4d0218f00d135996ae7a03c643 /gst/flacparse | |
parent | 1f2a0d3b3daea4ef63a6d49208346a0561538f54 (diff) | |
download | gst-plugins-bad-222322e7f372397c18a9bd092be1ba8581586799.tar.gz gst-plugins-bad-222322e7f372397c18a9bd092be1ba8581586799.tar.bz2 gst-plugins-bad-222322e7f372397c18a9bd092be1ba8581586799.zip |
baseparse: prevent infinite loop when draining
Diffstat (limited to 'gst/flacparse')
-rw-r--r-- | gst/flacparse/gstbaseparse.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gst/flacparse/gstbaseparse.c b/gst/flacparse/gstbaseparse.c index 24b3516f..ccc2f3eb 100644 --- a/gst/flacparse/gstbaseparse.c +++ b/gst/flacparse/gstbaseparse.c @@ -895,6 +895,8 @@ gst_base_parse_drain (GstBaseParse * parse) { guint avail; + GST_DEBUG_OBJECT (parse, "draining"); + for (;;) { avail = gst_adapter_available (parse->priv->adapter); if (!avail) @@ -904,6 +906,12 @@ gst_base_parse_drain (GstBaseParse * parse) if (gst_base_parse_chain (parse->sinkpad, NULL) != GST_FLOW_OK) { break; } + + /* nothing changed, maybe due to truncated frame; break infinite loop */ + if (avail == gst_adapter_available (parse->adapter)) { + GST_DEBUG_OBJECT (parse, "no change during draining; flushing"); + gst_adapter_clear (parse->adapter); + } } } |