Need push adapter remainning data in pass through mode

When switching to pass through mode, there might be remainning
data in the adpater, and it will be no chance to push to downstream when
in pass through mode.
So need check adapter available data and push downstream to avoid missing data

package: gstreamer1.0
ticket https://bugzilla.gnome.org/show_bug.cgi?id=760513
Upstream status: pending

Signed-off-by: Lyon Wang <lyon.wang@nxp.com>
diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c
old mode 100644
new mode 100755
index e9032df..967cc9f
--- a/libs/gst/base/gstbaseparse.c
+++ b/libs/gst/base/gstbaseparse.c
@@ -3153,6 +3153,21 @@
             && parse->priv->passthrough)) {
       GstBaseParseFrame frame;
 
+    av = gst_adapter_available (parse->priv->adapter);
+    if (av) {
+      tmpbuf = gst_adapter_take_buffer (parse->priv->adapter, av);
+
+      if (parse->priv->upstream_format == GST_FORMAT_TIME) {
+        tmpbuf = gst_buffer_make_writable (tmpbuf);
+        GST_BUFFER_PTS (tmpbuf) = parse->priv->next_pts;
+        GST_BUFFER_DTS (tmpbuf) = parse->priv->next_dts;
+        GST_BUFFER_DURATION (tmpbuf) = GST_CLOCK_TIME_NONE;
+      }
+
+      ret = gst_pad_push (parse->srcpad, tmpbuf);
+
+    }
+
       gst_base_parse_frame_init (&frame);
       frame.buffer = gst_buffer_make_writable (buffer);
       ret = gst_base_parse_push_frame (parse, &frame);