/* GStreamer
- * Copyright (C) <2007> Wim Taymans <wim@fluendo.com>
+ * Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
/* elementfactory information */
static const GstElementDetails gst_rtp_L16_pay_details =
-GST_ELEMENT_DETAILS ("RTP packet payloader",
+GST_ELEMENT_DETAILS ("RTP audio payloader",
"Codec/Payloader/Network",
"Payload-encode Raw audio into RTP packets (RFC 3551)",
- "Wim Taymans <wim@fluendo.com>");
+ "Wim Taymans <wim.taymans@gmail.com>");
static GstStaticPadTemplate gst_rtp_L16_pay_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink",
gst_rtp_L16_pay_class_init (GstRtpL16PayClass * klass)
{
GObjectClass *gobject_class;
- GstElementClass *gstelement_class;
GstBaseRTPPayloadClass *gstbasertppayload_class;
gobject_class = (GObjectClass *) klass;
- gstelement_class = (GstElementClass *) klass;
gstbasertppayload_class = (GstBaseRTPPayloadClass *) klass;
parent_class = g_type_class_peek_parent (klass);
guint samples;
GstClockTime duration;
+ /* calculate the amount of samples and round down the length */
+ samples = len / (2 * rtpL16pay->channels);
+ len = samples * (2 * rtpL16pay->channels);
+
/* now alloc output buffer */
outbuf = gst_rtp_buffer_new_allocate (len, 0, 0);
gst_adapter_copy (rtpL16pay->adapter, payload, 0, len);
gst_adapter_flush (rtpL16pay->adapter, len);
- samples = len / (2 * rtpL16pay->channels);
duration = gst_util_uint64_scale_int (samples, GST_SECOND, rtpL16pay->rate);
GST_BUFFER_TIMESTAMP (outbuf) = rtpL16pay->first_ts;
}
gst_caps_unref (otherpadcaps);
}
-
return caps;
}