dtmfsrc->last_event = NULL;
dtmfsrc->clock_id = NULL;
+ dtmfsrc->task_paused = TRUE;
GST_DEBUG_OBJECT (dtmfsrc, "init done");
}
GST_DEBUG_OBJECT (dtmfsrc,
"caps %" GST_PTR_FORMAT " set on src pad", caps);
-
+ dtmfsrc->task_paused = FALSE;
if (!gst_pad_start_task (dtmfsrc->srcpad,
(GstTaskFunction) gst_dtmf_src_push_next_tone_packet, dtmfsrc)) {
GST_ERROR_OBJECT (dtmfsrc, "Failed to start task on src pad");
{
GstDTMFSrcEvent *event = NULL;
+ dtmfsrc->task_paused = TRUE;
GST_OBJECT_LOCK (dtmfsrc);
if (dtmfsrc->clock_id != NULL) {
gst_clock_id_unschedule(dtmfsrc->clock_id);
GST_OBJECT_LOCK (dtmfsrc);
dtmfsrc->clock_id = clock_id;
GST_OBJECT_UNLOCK (dtmfsrc);
- clock_ret = gst_clock_id_wait (dtmfsrc->clock_id, NULL);
+
+ if (dtmfsrc->task_paused) {
+ clock_ret = GST_CLOCK_UNSCHEDULED;
+ } else {
+ clock_ret = gst_clock_id_wait (dtmfsrc->clock_id, NULL);
+ }
GST_OBJECT_LOCK (dtmfsrc);
dtmfsrc->clock_id = NULL;
GAsyncQueue* event_queue;
GstDTMFSrcEvent* last_event;
GstClockID clock_id;
+ gboolean task_paused;
guint16 interval;
GstClockTime timestamp;
dtmfsrc->clock_rate = DEFAULT_CLOCK_RATE;
dtmfsrc->interval = DEFAULT_PACKET_INTERVAL;
dtmfsrc->packet_redundancy = DEFAULT_PACKET_REDUNDANCY;
-
+ dtmfsrc->task_paused = TRUE;
dtmfsrc->event_queue = g_async_queue_new ();
dtmfsrc->last_event = NULL;
{
gst_rtp_dtmf_src_set_caps (dtmfsrc);
+ dtmfsrc->task_paused = FALSE;
if (!gst_pad_start_task (dtmfsrc->srcpad,
(GstTaskFunction) gst_rtp_dtmf_src_push_next_rtp_packet, dtmfsrc)) {
GST_ERROR_OBJECT (dtmfsrc, "Failed to start task on src pad");
GstRTPDTMFSrcEvent *event = NULL;
+ dtmfsrc->task_paused = TRUE;
GST_OBJECT_LOCK (dtmfsrc);
if (dtmfsrc->clock_id != NULL) {
gst_clock_id_unschedule(dtmfsrc->clock_id);
dtmfsrc->clock_id = clock_id;
GST_OBJECT_UNLOCK (dtmfsrc);
- clock_ret = gst_clock_id_wait (dtmfsrc->clock_id, NULL);
+ if (dtmfsrc->task_paused) {
+ clock_ret = GST_CLOCK_UNSCHEDULED;
+ } else {
+ clock_ret = gst_clock_id_wait (dtmfsrc->clock_id, NULL);
+ }
GST_OBJECT_LOCK (dtmfsrc);
dtmfsrc->clock_id = NULL;
GAsyncQueue* event_queue;
GstRTPDTMFSrcEvent* last_event;
GstClockID clock_id;
+ gboolean task_paused;
GstClockTime timestamp;
gboolean first_packet;