update for memory api changes

This commit is contained in:
Wim Taymans 2012-03-15 13:37:36 +01:00
parent 124a33dc95
commit 04a91237f3
2 changed files with 4 additions and 2 deletions

View file

@ -547,11 +547,12 @@ gst_dtmf_src_generate_tone (GstDTMFSrcEvent * event, DTMF_KEY key,
double i = 0;
double amplitude, f1, f2;
double volume_factor;
static GstAllocationParams params = { 0, 0, 0, 1, };
/* Create a buffer for the tone */
tone_size = ((duration / 1000) * sample_rate * SAMPLE_SIZE * CHANNELS) / 8;
buffer = gst_buffer_new_allocate (NULL, tone_size, 1);
buffer = gst_buffer_new_allocate (NULL, tone_size, &params);
gst_buffer_map (buffer, &map, GST_MAP_READWRITE);
p = (gint16 *) map.data;

View file

@ -342,12 +342,13 @@ gst_dtmf_src_generate_tone (GstRtpDTMFDepay * rtpdtmfdepay,
guint32 clock_rate = 8000 /* default */ ;
GstRTPBaseDepayload *depayload = GST_RTP_BASE_DEPAYLOAD (rtpdtmfdepay);
gint volume;
static GstAllocationParams params = { 0, 0, 0, 1, };
clock_rate = depayload->clock_rate;
/* Create a buffer for the tone */
tone_size = (payload.duration * SAMPLE_SIZE * CHANNELS) / 8;
buf = gst_buffer_new_allocate (NULL, tone_size, 1);
buf = gst_buffer_new_allocate (NULL, tone_size, &params);
GST_BUFFER_DURATION (buf) = payload.duration * GST_SECOND / clock_rate;
volume = payload.volume;