diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2010-12-30 16:24:16 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2010-12-30 16:24:46 +0100 |
commit | 9c2393490f07bfb094d6983d9a54a972eb975e67 (patch) | |
tree | 5eeae319d72363495635ec8abb95579d859d7788 | |
parent | 756869421c7d39ca6588307a3cb7c6a9b8adc985 (diff) |
mp4adepay: fix timestamps on buffers
-rw-r--r-- | gst/rtp/gstrtpmp4adepay.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/gst/rtp/gstrtpmp4adepay.c b/gst/rtp/gstrtpmp4adepay.c index 3579d900b..836ff9f09 100644 --- a/gst/rtp/gstrtpmp4adepay.c +++ b/gst/rtp/gstrtpmp4adepay.c @@ -263,8 +263,11 @@ gst_rtp_mp4a_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) guint i; guint8 *data; guint pos; + GstClockTime timestamp; + guint offset; avail = gst_adapter_available (rtpmp4adepay->adapter); + timestamp = gst_adapter_prev_timestamp (rtpmp4adepay->adapter, NULL); GST_LOG_OBJECT (rtpmp4adepay, "have marker and %u available", avail); @@ -272,18 +275,16 @@ gst_rtp_mp4a_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) data = GST_BUFFER_DATA (outbuf); /* position in data we are at */ pos = 0; + /* timestamp offset */ + offset = 0; /* looping through the number of sub-frames in the audio payload */ for (i = 0; i <= rtpmp4adepay->numSubFrames; i++) { /* determine payload length and set buffer data pointer accordingly */ guint skip; guint data_len; - guint32 timestamp; - GstBuffer *tmp = NULL; - timestamp = gst_rtp_buffer_get_timestamp (buf); - /* each subframe starts with a variable length encoding */ data_len = 0; for (skip = 0; skip < avail; skip++) { @@ -314,13 +315,11 @@ gst_rtp_mp4a_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) data += skip; avail -= skip; - gst_buffer_set_caps (tmp, GST_PAD_CAPS (depayload->srcpad)); + GST_BUFFER_TIMESTAMP (tmp) = timestamp; + gst_base_rtp_depayload_push (depayload, tmp); - /* only apply the timestamp for the first buffer. Based on gstrtpmp4gdepay.c */ - if (i == 0) - gst_base_rtp_depayload_push_ts (depayload, timestamp, tmp); - else - gst_base_rtp_depayload_push (depayload, tmp); + /* only apply the timestamp for the first buffer */ + timestamp = -1; } /* just a check that lengths match */ |