diff options
-rw-r--r-- | gst/aacparse/gstbaseparse.c | 8 | ||||
-rw-r--r-- | gst/amrparse/gstbaseparse.c | 8 | ||||
-rw-r--r-- | gst/flacparse/gstbaseparse.c | 8 |
3 files changed, 24 insertions, 0 deletions
diff --git a/gst/aacparse/gstbaseparse.c b/gst/aacparse/gstbaseparse.c index ffb17f3f..cdd8b182 100644 --- a/gst/aacparse/gstbaseparse.c +++ b/gst/aacparse/gstbaseparse.c @@ -872,6 +872,8 @@ gst_base_parse_drain (GstBaseParse * parse) { guint avail; + GST_DEBUG_OBJECT (parse, "draining"); + for (;;) { avail = gst_adapter_available (parse->adapter); if (!avail) @@ -881,6 +883,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); + } } } diff --git a/gst/amrparse/gstbaseparse.c b/gst/amrparse/gstbaseparse.c index f4d08fc7..68a8aad6 100644 --- a/gst/amrparse/gstbaseparse.c +++ b/gst/amrparse/gstbaseparse.c @@ -872,6 +872,8 @@ gst_base_parse_drain (GstBaseParse * parse) { guint avail; + GST_DEBUG_OBJECT (parse, "draining"); + for (;;) { avail = gst_adapter_available (parse->adapter); if (!avail) @@ -881,6 +883,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); + } } } 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); + } } } |