dtmf: Remove leftover MAEMO_BROKEN defines

Remove defines to work around bugs in old Maemo releases
This commit is contained in:
Olivier Crête 2011-04-12 16:42:17 -04:00
parent 3c86c6432a
commit 27cafd8d8e
2 changed files with 7 additions and 28 deletions

View file

@ -113,7 +113,7 @@
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "config.h" #include "config.h"
#endif #endif
#include <stdlib.h> #include <stdlib.h>
@ -123,7 +123,7 @@
#include <glib.h> #include <glib.h>
#ifndef M_PI #ifndef M_PI
# define M_PI 3.14159265358979323846 /* pi */ #define M_PI 3.14159265358979323846 /* pi */
#endif #endif
@ -457,17 +457,11 @@ static void
gst_dtmf_prepare_timestamps (GstDTMFSrc * dtmfsrc) gst_dtmf_prepare_timestamps (GstDTMFSrc * dtmfsrc)
{ {
GstClock *clock; GstClock *clock;
GstClockTime base_time;
base_time = gst_element_get_base_time (GST_ELEMENT (dtmfsrc));
clock = gst_element_get_clock (GST_ELEMENT (dtmfsrc)); clock = gst_element_get_clock (GST_ELEMENT (dtmfsrc));
if (clock != NULL) { if (clock != NULL) {
#ifdef MAEMO_BROKEN dtmfsrc->timestamp = gst_clock_get_time (clock)
dtmfsrc->timestamp = gst_clock_get_time (clock); - gst_element_get_base_time (GST_ELEMENT (dtmfsrc));
#else
dtmfsrc->timestamp = gst_clock_get_time (clock) - base_time;
#endif
gst_object_unref (clock); gst_object_unref (clock);
} else { } else {
gchar *dtmf_name = gst_element_get_name (dtmfsrc); gchar *dtmf_name = gst_element_get_name (dtmfsrc);
@ -696,12 +690,8 @@ gst_dtmf_src_create (GstBaseSrc * basesrc, guint64 offset,
clock = gst_element_get_clock (GST_ELEMENT (basesrc)); clock = gst_element_get_clock (GST_ELEMENT (basesrc));
#ifdef MAEMO_BROKEN
clockid = gst_clock_new_single_shot_id (clock, dtmfsrc->timestamp);
#else
clockid = gst_clock_new_single_shot_id (clock, dtmfsrc->timestamp + clockid = gst_clock_new_single_shot_id (clock, dtmfsrc->timestamp +
gst_element_get_base_time (GST_ELEMENT (dtmfsrc))); gst_element_get_base_time (GST_ELEMENT (dtmfsrc)));
#endif
gst_object_unref (clock); gst_object_unref (clock);
GST_OBJECT_LOCK (dtmfsrc); GST_OBJECT_LOCK (dtmfsrc);

View file

@ -111,7 +111,7 @@
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "config.h" #include "config.h"
#endif #endif
#include <stdlib.h> #include <stdlib.h>
@ -515,18 +515,12 @@ static void
gst_rtp_dtmf_prepare_timestamps (GstRTPDTMFSrc * dtmfsrc) gst_rtp_dtmf_prepare_timestamps (GstRTPDTMFSrc * dtmfsrc)
{ {
GstClock *clock; GstClock *clock;
GstClockTime base_time;
#ifdef MAEMO_BROKEN
base_time = 0;
#else
base_time = gst_element_get_base_time (GST_ELEMENT (dtmfsrc));
#endif
clock = gst_element_get_clock (GST_ELEMENT (dtmfsrc)); clock = gst_element_get_clock (GST_ELEMENT (dtmfsrc));
if (clock != NULL) { if (clock != NULL) {
dtmfsrc->timestamp = gst_clock_get_time (clock) dtmfsrc->timestamp = gst_clock_get_time (clock)
+ (MIN_INTER_DIGIT_INTERVAL * GST_MSECOND) - base_time; + (MIN_INTER_DIGIT_INTERVAL * GST_MSECOND)
- gst_element_get_base_time (GST_ELEMENT (dtmfsrc));
dtmfsrc->start_timestamp = dtmfsrc->timestamp; dtmfsrc->start_timestamp = dtmfsrc->timestamp;
gst_object_unref (clock); gst_object_unref (clock);
} else { } else {
@ -742,13 +736,8 @@ gst_rtp_dtmf_src_create (GstBaseSrc * basesrc, guint64 offset,
GST_DEBUG_OBJECT (dtmfsrc, "Processed events, now lets wait on the clock"); GST_DEBUG_OBJECT (dtmfsrc, "Processed events, now lets wait on the clock");
clock = gst_element_get_clock (GST_ELEMENT (basesrc)); clock = gst_element_get_clock (GST_ELEMENT (basesrc));
#ifdef MAEMO_BROKEN
clockid = gst_clock_new_single_shot_id (clock, dtmfsrc->timestamp);
#else
clockid = gst_clock_new_single_shot_id (clock, dtmfsrc->timestamp + clockid = gst_clock_new_single_shot_id (clock, dtmfsrc->timestamp +
gst_element_get_base_time (GST_ELEMENT (dtmfsrc))); gst_element_get_base_time (GST_ELEMENT (dtmfsrc)));
#endif
gst_object_unref (clock); gst_object_unref (clock);
GST_OBJECT_LOCK (dtmfsrc); GST_OBJECT_LOCK (dtmfsrc);