diff options
Diffstat (limited to 'gst/amrparse/gstbaseparse.c')
-rw-r--r-- | gst/amrparse/gstbaseparse.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gst/amrparse/gstbaseparse.c b/gst/amrparse/gstbaseparse.c index 870492a8..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); + } } } @@ -950,6 +958,7 @@ gst_base_parse_chain (GstPad * pad, GstBuffer * buffer) GST_DEBUG_OBJECT (parse, "found valid frame but not enough data available (only %d bytes)", gst_adapter_available (parse->adapter)); + gst_buffer_unref (tmpbuf); goto done; } break; |