alsasink: really use local ringbuffer spec helper var and init it a bit more

... to avoid assertion failures

Conflicts:

	ext/alsa/gstalsasink.c
This commit is contained in:
Mark Nauwelaerts 2012-05-08 17:35:45 +02:00 committed by Sebastian Dröge
parent c6409806c1
commit 1c70c5b85e

View file

@ -325,12 +325,10 @@ gst_alsasink_getcaps (GstBaseSink * bsink, GstCaps * filter)
static gboolean static gboolean
gst_alsasink_acceptcaps (GstAlsaSink * alsa, GstCaps * caps) gst_alsasink_acceptcaps (GstAlsaSink * alsa, GstCaps * caps)
{ {
GstAudioRingBuffer *rbuf = GST_AUDIO_BASE_SINK (alsa)->ringbuffer;
GstPad *pad = GST_BASE_SINK (alsa)->sinkpad; GstPad *pad = GST_BASE_SINK (alsa)->sinkpad;
GstCaps *pad_caps; GstCaps *pad_caps;
GstStructure *st; GstStructure *st;
gboolean ret = FALSE; gboolean ret = FALSE;
GstAudioRingBufferSpec spec = { 0 }; GstAudioRingBufferSpec spec = { 0 };
pad_caps = gst_pad_query_caps (pad, caps); pad_caps = gst_pad_query_caps (pad, caps);
@ -347,11 +345,14 @@ gst_alsasink_acceptcaps (GstAlsaSink * alsa, GstCaps * caps)
if (!gst_caps_is_fixed (caps)) if (!gst_caps_is_fixed (caps))
goto done; goto done;
if (!gst_audio_ring_buffer_parse_caps (&rbuf->spec, caps)) /* parse helper expects this set, so avoid nasty warning
* will be set properly later on anyway */
spec.latency_time = GST_SECOND;
if (!gst_audio_ring_buffer_parse_caps (&spec, caps))
goto done; goto done;
/* Make sure input is framed (one frame per buffer) and can be payloaded */ /* Make sure input is framed (one frame per buffer) and can be payloaded */
switch (rbuf->spec.type) { switch (spec.type) {
case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_AC3: case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_AC3:
case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_EAC3: case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_EAC3:
case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_DTS: case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_DTS: