summaryrefslogtreecommitdiff
path: root/recipes-multimedia/gstreamer/gstreamer1.0/0004-gstbaseparse-Need-push-adapter-remainning-data-in-pa.patch
blob: 303e10820eb8a841be36aef46fc833414565b63e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From b7f3a53b5d43c40fc1432c12f2ca314c5dbf403b Mon Sep 17 00:00:00 2001
From: Lyon Wang <lyon.wang@nxp.com>
Date: Fri, 15 Jan 2016 17:30:14 +0800
Subject: [PATCH 4/7] [gstbaseparse] 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
Upstream-Status: Pending [https://bugzilla.gnome.org/show_bug.cgi?id=760513]

Signed-off-by: Lyon Wang <lyon.wang@nxp.com>
---
 libs/gst/base/gstbaseparse.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 mode change 100644 => 100755 libs/gst/base/gstbaseparse.c

diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c
old mode 100644
new mode 100755
index 3c52887..6d3eacf
--- a/libs/gst/base/gstbaseparse.c
+++ b/libs/gst/base/gstbaseparse.c
@@ -3138,6 +3138,21 @@ gst_base_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
             && 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);
-- 
1.9.1