summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--gst/h264parse/gsth264parse.c19
2 files changed, 24 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 7d0c9c60..f17737a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-01-18 Wim Taymans <wim.taymans@collabora.co.uk>
+
+ * gst/h264parse/gsth264parse.c: (gst_h264_parse_flush_decode),
+ (gst_h264_parse_queue_buffer), (gst_h264_parse_chain_reverse):
+ Set timestamps more correctly.
+
2008-01-18 Sebastian Dröge <slomo@circular-chaos.org>
* gst/rawparse/gstrawparse.c: (gst_raw_parse_class_init),
diff --git a/gst/h264parse/gsth264parse.c b/gst/h264parse/gsth264parse.c
index 832bb49f..1dc354ec 100644
--- a/gst/h264parse/gsth264parse.c
+++ b/gst/h264parse/gsth264parse.c
@@ -475,6 +475,11 @@ gst_h264_parse_flush_decode (GstH264Parse * h264parse)
GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_DISCONT);
}
+ if (link->i_frame)
+ GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_DELTA_UNIT);
+ else
+ GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT);
+
GST_DEBUG_OBJECT (h264parse, "pushing buffer %p, ts %" GST_TIME_FORMAT,
buf, GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
@@ -500,6 +505,7 @@ gst_h264_parse_queue_buffer (GstH264Parse * parse, GstBuffer * buffer)
GstNalBs bs;
GstNalList *link;
GstFlowReturn res = GST_FLOW_OK;
+ GstClockTime timestamp;
/* create new NALU link */
link = gst_nal_list_new (buffer);
@@ -507,11 +513,14 @@ gst_h264_parse_queue_buffer (GstH264Parse * parse, GstBuffer * buffer)
/* first parse the buffer */
data = GST_BUFFER_DATA (buffer);
size = GST_BUFFER_SIZE (buffer);
+ timestamp = GST_BUFFER_TIMESTAMP (buffer);
link->slice = FALSE;
link->i_frame = FALSE;
- GST_DEBUG_OBJECT (parse, "analyse buffer of size %u", size);
+ GST_DEBUG_OBJECT (parse,
+ "analyse buffer of size %u, timestamp %" GST_TIME_FORMAT, size,
+ GST_TIME_ARGS (buffer));
/* now parse all the NAL units in this buffer, for bytestream we only have one
* NAL unit but for packetized streams we can have multiple ones */
@@ -620,6 +629,7 @@ gst_h264_parse_chain_reverse (GstH264Parse * h264parse, gboolean discont,
guint start, stop, last;
guint32 code;
GstBuffer *prev;
+ GstClockTime timestamp;
GST_DEBUG_OBJECT (h264parse,
"received discont, copy gathered buffers for decoding");
@@ -658,6 +668,11 @@ gst_h264_parse_chain_reverse (GstH264Parse * h264parse, gboolean discont,
last = GST_BUFFER_SIZE (gbuf);
data = GST_BUFFER_DATA (gbuf);
+ timestamp = GST_BUFFER_TIMESTAMP (gbuf);
+
+ GST_DEBUG_OBJECT (h264parse,
+ "buffer size: %u, timestamp %" GST_TIME_FORMAT, last,
+ GST_TIME_ARGS (timestamp));
while (last > 0) {
GST_DEBUG_OBJECT (h264parse, "scan from %u", last);
@@ -673,6 +688,8 @@ gst_h264_parse_chain_reverse (GstH264Parse * h264parse, gboolean discont,
* decode queue. */
decode = gst_buffer_create_sub (gbuf, start, last - start);
+ GST_BUFFER_TIMESTAMP (decode) = timestamp;
+
/* see what we have here */
res = gst_h264_parse_queue_buffer (h264parse, decode);