summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorYouness Alaoui <youness.alaoui@collabora.co.uk>2007-08-22 17:51:26 +0000
committerEdward Hervey <bilboed@bilboed.com>2009-02-21 17:47:59 +0100
commit7e0aec2c94d5604be8909aaf4028447232b425cc (patch)
tree558d1b53e3d6a2394773088731f9262b8ee13187 /gst
parent7b9a2fd4ff375b231eb99031e78466b2f9152b4d (diff)
downloadgst-plugins-bad-7e0aec2c94d5604be8909aaf4028447232b425cc.tar.gz
gst-plugins-bad-7e0aec2c94d5604be8909aaf4028447232b425cc.tar.bz2
gst-plugins-bad-7e0aec2c94d5604be8909aaf4028447232b425cc.zip
[MOVED FROM GST-P-FARSIGHT] Moved the timestamp from the event to dtmfsrc structure since we have only one event at a time, so let's keep it stored in the dtmfsrc struct
20070822175126-4f0f6-53bcda2bd8ae8c56d29e62e69ac19a30e08ad350.gz
Diffstat (limited to 'gst')
-rw-r--r--gst/dtmf/gstdtmfsrc.c12
-rw-r--r--gst/dtmf/gstdtmfsrc.h2
2 files changed, 7 insertions, 7 deletions
diff --git a/gst/dtmf/gstdtmfsrc.c b/gst/dtmf/gstdtmfsrc.c
index 0959e6d4..2d5d92db 100644
--- a/gst/dtmf/gstdtmfsrc.c
+++ b/gst/dtmf/gstdtmfsrc.c
@@ -513,18 +513,18 @@ gst_dtmf_src_set_stream_lock (GstDTMFSrc *dtmfsrc, gboolean lock)
}
static void
-gst_dtmf_prepare_timestamps (GstDTMFSrc *dtmfsrc, GstDTMFSrcEvent *event)
+gst_dtmf_prepare_timestamps (GstDTMFSrc *dtmfsrc)
{
GstClock *clock;
clock = GST_ELEMENT_CLOCK (dtmfsrc);
if (clock != NULL)
- event->timestamp = gst_clock_get_time (GST_ELEMENT_CLOCK (dtmfsrc));
+ dtmfsrc->timestamp = gst_clock_get_time (GST_ELEMENT_CLOCK (dtmfsrc));
else {
GST_ERROR_OBJECT (dtmfsrc, "No clock set for element %s",
GST_ELEMENT_NAME (dtmfsrc));
- event->timestamp = GST_CLOCK_TIME_NONE;
+ dtmfsrc->timestamp = GST_CLOCK_TIME_NONE;
}
}
@@ -716,8 +716,8 @@ gst_dtmf_src_create_next_tone_packet (GstDTMFSrc *dtmfsrc, GstDTMFSrcEvent *even
/* timestamp and duration of GstBuffer */
GST_BUFFER_DURATION (buf) = duration * GST_MSECOND;
- GST_BUFFER_TIMESTAMP (buf) = event->timestamp;
- event->timestamp += GST_BUFFER_DURATION (buf);
+ GST_BUFFER_TIMESTAMP (buf) = dtmfsrc->timestamp;
+ dtmfsrc->timestamp += GST_BUFFER_DURATION (buf);
/* FIXME: Should we sync to clock ourselves or leave it to sink */
gst_dtmf_src_wait_for_buffer_ts (dtmfsrc, buf);
@@ -743,7 +743,7 @@ gst_dtmf_src_push_next_tone_packet (GstDTMFSrc *dtmfsrc)
if (event->event_type == DTMF_EVENT_TYPE_STOP) {
GST_WARNING_OBJECT (dtmfsrc, "Received a DTMF stop event when already stopped", GST_BUFFER_SIZE (buf));
} else if (event->event_type == DTMF_EVENT_TYPE_START) {
- gst_dtmf_prepare_timestamps (dtmfsrc, event);
+ gst_dtmf_prepare_timestamps (dtmfsrc);
/* Don't forget to get exclusive access to the stream */
gst_dtmf_src_set_stream_lock (dtmfsrc, TRUE);
diff --git a/gst/dtmf/gstdtmfsrc.h b/gst/dtmf/gstdtmfsrc.h
index 544b66e5..1e341fdc 100644
--- a/gst/dtmf/gstdtmfsrc.h
+++ b/gst/dtmf/gstdtmfsrc.h
@@ -58,7 +58,6 @@ enum _GstDTMFEventType {
typedef enum _GstDTMFEventType GstDTMFEventType;
struct _GstDTMFSrcEvent {
- GstClockTime timestamp;
GstDTMFEventType event_type;
double sample;
guint16 event_number;
@@ -76,6 +75,7 @@ struct _GstDTMFSrc {
GstDTMFSrcEvent* last_event;
guint16 interval;
+ GstClockTime timestamp;
};