~ubuntu-branches/ubuntu/vivid/gst-plugins-good0.10/vivid-proposed

« back to all changes in this revision

Viewing changes to ext/pulse/pulsesink.c

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2012-11-16 12:51:49 UTC
  • Revision ID: package-import@ubuntu.com-20121116125149-detwbxkij60ae6r1
Tags: 0.10.31-3ubuntu2
debian/patches/git_ring_buffer_null_check.patch: segfault fix, 
thanks Erik Botö for backporting and testing the change (lp: #1068155)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2053
2053
gst_pulsesink_pad_acceptcaps (GstPad * pad, GstCaps * caps)
2054
2054
{
2055
2055
  GstPulseSink *psink = GST_PULSESINK (gst_pad_get_parent_element (pad));
2056
 
  GstPulseRingBuffer *pbuf = GST_PULSERING_BUFFER_CAST (GST_BASE_AUDIO_SINK
2057
 
      (psink)->ringbuffer);
 
2056
 
 
2057
  GstPulseRingBuffer *pbuf = NULL;
2058
2058
  GstCaps *pad_caps;
2059
2059
  GstStructure *st;
2060
2060
  gboolean ret = FALSE;
2073
2073
    gst_caps_unref (pad_caps);
2074
2074
  }
2075
2075
 
2076
 
  /* Either template caps didn't match, or we're still in NULL state */
2077
 
  if (!ret || !pbuf->context)
 
2076
  /* Template caps didn't match */
 
2077
  if (!ret)
2078
2078
    goto done;
2079
2079
 
2080
2080
  /* If we've not got fixed caps, creating a stream might fail, so let's just
2082
2082
  if (!gst_caps_is_fixed (caps))
2083
2083
    goto done;
2084
2084
 
 
2085
  GST_OBJECT_LOCK (psink);
 
2086
  pbuf = GST_PULSERING_BUFFER_CAST (GST_BASE_AUDIO_SINK (psink)->ringbuffer);
 
2087
  if (pbuf != NULL)
 
2088
    gst_object_ref (pbuf);
 
2089
  GST_OBJECT_UNLOCK (psink);
 
2090
 
 
2091
  /* We're still in NULL state */
 
2092
  if (pbuf == NULL)
 
2093
    goto done;
 
2094
 
 
2095
  pa_threaded_mainloop_lock (mainloop);
 
2096
 
 
2097
  if (pbuf->context == NULL)
 
2098
    goto out;
 
2099
 
2085
2100
  ret = FALSE;
2086
2101
 
2087
 
  pa_threaded_mainloop_lock (mainloop);
2088
 
 
2089
2102
  spec.latency_time = GST_BASE_AUDIO_SINK (psink)->latency_time;
2090
2103
  if (!gst_ring_buffer_parse_caps (&spec, caps))
2091
2104
    goto out;
2169
2182
 
2170
2183
  pa_threaded_mainloop_unlock (mainloop);
2171
2184
 
 
2185
  gst_object_unref (pbuf);
 
2186
 
2172
2187
done:
2173
2188
  gst_object_unref (psink);
2174
2189
  return ret;