summaryrefslogtreecommitdiffstats
path: root/gst/rtp/gstrtppcmadepay.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2007-04-25 09:47:48 +0000
committerWim Taymans <wim.taymans@gmail.com>2007-04-25 09:47:48 +0000
commit24c5812d65e45f630edd172ce493ab9fac6df887 (patch)
treee6e532be7522238565734287de46f875c0a0ac78 /gst/rtp/gstrtppcmadepay.c
parent1beeda3ff2859372cecbea4542a4da8dc05960d6 (diff)
gst/rtp/: Make sure we configure the clock_rate in the baseclass in the setcaps function. Fixes #431282.
Original commit message from CVS: * gst/rtp/gstrtpL16depay.c: (gst_rtp_L16_depay_set_property): * gst/rtp/gstrtpamrdepay.c: (gst_rtp_amr_depay_init), (gst_rtp_amr_depay_setcaps), (gst_rtp_amr_depay_process): * gst/rtp/gstrtpgsmdepay.c: (gst_rtp_gsm_depay_init), (gst_rtp_gsm_depay_setcaps): * gst/rtp/gstrtph263pdepay.c: (gst_rtp_h263p_depay_setcaps): * gst/rtp/gstrtph264depay.c: (gst_rtp_h264_depay_setcaps): * gst/rtp/gstrtpilbcdepay.c: (gst_rtp_ilbc_depay_class_init), (gst_rtp_ilbc_depay_init), (gst_rtp_ilbc_depay_setcaps), (gst_rtp_ilbc_depay_process), (gst_ilbc_depay_set_property), (gst_ilbc_depay_get_property): * gst/rtp/gstrtpmp2tdepay.c: (gst_rtp_mp2t_depay_setcaps): * gst/rtp/gstrtpmp4adepay.c: * gst/rtp/gstrtppcmadepay.c: (gst_rtp_pcma_depay_init), (gst_rtp_pcma_depay_setcaps): * gst/rtp/gstrtppcmudepay.c: (gst_rtp_pcmu_depay_init), (gst_rtp_pcmu_depay_setcaps): Make sure we configure the clock_rate in the baseclass in the setcaps function. Fixes #431282.
Diffstat (limited to 'gst/rtp/gstrtppcmadepay.c')
-rw-r--r--gst/rtp/gstrtppcmadepay.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gst/rtp/gstrtppcmadepay.c b/gst/rtp/gstrtppcmadepay.c
index 6b03ba5a..f41f7f1d 100644
--- a/gst/rtp/gstrtppcmadepay.c
+++ b/gst/rtp/gstrtppcmadepay.c
@@ -112,7 +112,6 @@ gst_rtp_pcma_depay_init (GstRtpPcmaDepay * rtppcmadepay,
depayload = GST_BASE_RTP_DEPAYLOAD (rtppcmadepay);
- depayload->clock_rate = 8000;
gst_pad_use_fixed_caps (GST_BASE_RTP_DEPAYLOAD_SRCPAD (depayload));
}
@@ -120,11 +119,17 @@ static gboolean
gst_rtp_pcma_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps)
{
GstCaps *srccaps;
+ GstStructure *structure;
gboolean ret;
+ gint clock_rate = 8000; /* default */
- srccaps = gst_caps_new_simple ("audio/x-alaw",
- "channels", G_TYPE_INT, 1, "rate", G_TYPE_INT, 8000, NULL);
+ structure = gst_caps_get_structure (caps, 0);
+
+ gst_structure_get_int (structure, "clock-rate", &clock_rate);
+ depayload->clock_rate = clock_rate;
+ srccaps = gst_caps_new_simple ("audio/x-alaw",
+ "channels", G_TYPE_INT, 1, "rate", G_TYPE_INT, clock_rate, NULL);
ret = gst_pad_set_caps (GST_BASE_RTP_DEPAYLOAD_SRCPAD (depayload), srccaps);
gst_caps_unref (srccaps);