From c6daa24e8bc272f855c9ef57ec381979395b9169 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 31 Dec 2002 16:42:28 +0000 Subject: [PATCH] Cleanups + better timestamp capture Original commit message from CVS: Cleanups + better timestamp capture --- libs/gst/bytestream/bytestream.c | 5 ++++- libs/gst/bytestream/bytestream.h | 16 ++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/libs/gst/bytestream/bytestream.c b/libs/gst/bytestream/bytestream.c index 24afa27bea..729a42f52e 100644 --- a/libs/gst/bytestream/bytestream.c +++ b/libs/gst/bytestream/bytestream.c @@ -136,6 +136,7 @@ gst_bytestream_get_next_buf (GstByteStream *bs) { GstBuffer *nextbuf, *lastbuf, *headbuf; GSList *end; + GstClockTime ts; /* if there is an event pending, return FALSE */ if (bs->event) @@ -152,7 +153,9 @@ gst_bytestream_get_next_buf (GstByteStream *bs) if (!nextbuf) return FALSE; - bs->last_ts = GST_BUFFER_TIMESTAMP (nextbuf); + ts = GST_BUFFER_TIMESTAMP (nextbuf); + if (ts != GST_CLOCK_TIME_NONE) + bs->last_ts = ts; bs_print ("get_next_buf: got buffer of %d bytes", GST_BUFFER_SIZE (nextbuf)); diff --git a/libs/gst/bytestream/bytestream.h b/libs/gst/bytestream/bytestream.h index 391afd27c8..4cced0d886 100644 --- a/libs/gst/bytestream/bytestream.h +++ b/libs/gst/bytestream/bytestream.h @@ -27,24 +27,24 @@ G_BEGIN_DECLS typedef struct _GstByteStream GstByteStream; struct _GstByteStream { - GstPad *pad; + GstPad *pad; - GstEvent * event; + GstEvent *event; GSList *buflist; - guint32 headbufavail; - guint32 listavail; + guint32 headbufavail; + guint32 listavail; /* we keep state of assembled pieces */ guint8 *assembled; - guint32 assembled_len; + guint32 assembled_len; /* this is needed for gst_bytestream_tell */ - guint64 offset; - guint64 last_ts; + guint64 offset; + guint64 last_ts; /* if we are in the seek state (waiting for DISCONT) */ - gboolean in_seek; + gboolean in_seek; }; GstByteStream* gst_bytestream_new (GstPad *pad);