GST_INFO_OBJECT (element, "new pa main loop thread");
if (!(mainloop = pa_threaded_mainloop_new ()))
goto mainloop_failed;
+ if (pa_threaded_mainloop_start (mainloop) < 0) {
+ pa_threaded_mainloop_free (mainloop);
+ goto mainloop_start_failed;
+ }
mainloop_ref_ct = 1;
- pa_threaded_mainloop_start (mainloop);
- g_mutex_unlock (pa_shared_resource_mutex);
+ g_mutex_unlock (&pa_shared_resource_mutex);
} else {
GST_INFO_OBJECT (element, "reusing pa main loop thread");
mainloop_ref_ct++;
("pa_threaded_mainloop_new() failed"), (NULL));
return GST_STATE_CHANGE_FAILURE;
}
- g_mutex_unlock (pa_shared_resource_mutex);
+ mainloop_start_failed:
+ {
++ g_mutex_unlock (&pa_shared_resource_mutex);
+ GST_ELEMENT_ERROR (pulsesink, RESOURCE, FAILED,
+ ("pa_threaded_mainloop_start() failed"), (NULL));
+ return GST_STATE_CHANGE_FAILURE;
+ }
state_failure:
{
if (transition == GST_STATE_CHANGE_NULL_TO_READY) {
GST_DEBUG_OBJECT (query, "total frames is %" G_GUINT32_FORMAT,
stream->idx_n);
- if (stream->idx_n >= 0)
+ if (stream->idx_n > 0)
gst_query_set_duration (query, fmt, stream->idx_n);
else if (gst_pad_query_convert (pad, GST_FORMAT_TIME,
- duration, &fmt, &dur))
+ duration, fmt, &dur))
gst_query_set_duration (query, fmt, dur);
break;
}
static GstCaps *
-gst_rtp_h263p_pay_sink_getcaps (GstBaseRTPPayload * payload, GstPad * pad)
+gst_rtp_h263p_pay_sink_getcaps (GstRTPBasePayload * payload, GstPad * pad,
+ GstCaps * filter)
{
GstRtpH263PPay *rtph263ppay;
- GstCaps *caps = gst_caps_new_empty ();
+ GstCaps *caps = NULL;
GstCaps *peercaps = NULL;
GstCaps *intersect = NULL;
guint i;
}
static void
-gst_rtp_bin_init (GstRtpBin * rtpbin, GstRtpBinClass * klass)
+gst_rtp_bin_init (GstRtpBin * rtpbin)
{
- gchar *str;
+ gchar *cname;
rtpbin->priv = GST_RTP_BIN_GET_PRIVATE (rtpbin);
- rtpbin->priv->bin_lock = g_mutex_new ();
- rtpbin->priv->dyn_lock = g_mutex_new ();
+ g_mutex_init (&rtpbin->priv->bin_lock);
+ g_mutex_init (&rtpbin->priv->dyn_lock);
rtpbin->latency_ms = DEFAULT_LATENCY_MS;
rtpbin->latency_ns = DEFAULT_LATENCY_MS * GST_MSECOND;
GstPad *srcpad;
GstRtpPtDemuxPad *rtpdemuxpad;
GstCaps *caps;
- GstRTPBuffer rtp = {NULL};
++ GstRTPBuffer rtp = { NULL };
- rtpdemux = GST_RTP_PT_DEMUX (GST_OBJECT_PARENT (pad));
+ rtpdemux = GST_RTP_PT_DEMUX (parent);
if (!gst_rtp_buffer_validate (buf))
goto invalid_buffer;
GstPadTemplate *templ;
gchar *padname;
+ caps = gst_rtp_pt_demux_get_caps (rtpdemux, pt);
+ if (!caps)
+ goto no_caps;
+
klass = GST_ELEMENT_GET_CLASS (rtpdemux);
- templ = gst_element_class_get_pad_template (klass, "src_%d");
- padname = g_strdup_printf ("src_%d", pt);
+ templ = gst_element_class_get_pad_template (klass, "src_%u");
+ padname = g_strdup_printf ("src_%u", pt);
srcpad = gst_pad_new_from_template (templ, padname);
gst_pad_use_fixed_caps (srcpad);
g_free (padname);
/* this is the final event function we receive on the internal source pad when
* we deal with TCP connections */
static gboolean
-gst_rtspsrc_handle_internal_src_event (GstPad * pad, GstEvent * event)
+gst_rtspsrc_handle_internal_src_event (GstPad * pad, GstObject * parent,
+ GstEvent * event)
{
- GstRTSPSrc *src;
gboolean res;
- src = GST_RTSPSRC_CAST (gst_pad_get_element_private (pad));
-
- GST_DEBUG_OBJECT (src, "pad %s:%s received event %s",
- GST_DEBUG_PAD_NAME (pad), GST_EVENT_TYPE_NAME (event));
+ GST_DEBUG_OBJECT (pad, "received event %s", GST_EVENT_TYPE_NAME (event));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEEK:
if (ioctl (oss->fd, SNDCTL_DSP_GET_PLAYTGT_NAMES, &routings) != -1) {
GST_LOG_OBJECT (oss, "%u output routings (static list: %d)",
-- routings.nvalues, !!(routings.version == 0));
++ routings.nvalues, ! !(routings.version == 0));
for (i = 0; i < routings.nvalues; ++i) {
GST_LOG_OBJECT (oss, " output routing %d: %s", i,
&routings.strings[routings.strindex[i]]);