directsoundsink: fix acceptcaps check

This commit is contained in:
Andoni Morales Alastruey 2012-05-29 11:37:59 +00:00 committed by Sebastian Dröge
parent ed8ad7bffe
commit 1c6d1bd29a

View file

@ -311,9 +311,9 @@ gst_directsound_sink_acceptcaps (GstBaseSink * sink, GstQuery * query)
pad_caps = gst_pad_query_caps (pad, NULL); pad_caps = gst_pad_query_caps (pad, NULL);
if (pad_caps) { if (pad_caps) {
ret = gst_caps_can_intersect (pad_caps, caps); gboolean cret = gst_caps_can_intersect (pad_caps, caps);
gst_caps_unref (pad_caps); gst_caps_unref (pad_caps);
if (!ret) if (!cret)
goto done; goto done;
} }
@ -326,7 +326,10 @@ gst_directsound_sink_acceptcaps (GstBaseSink * sink, GstQuery * query)
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 */
if (gst_directsound_sink_is_spdif_format (dsink)) switch (spec.type)
{
case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_AC3:
case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_DTS:
{ {
gboolean framed = FALSE, parsed = FALSE; gboolean framed = FALSE, parsed = FALSE;
st = gst_caps_get_structure (caps, 0); st = gst_caps_get_structure (caps, 0);
@ -336,6 +339,9 @@ gst_directsound_sink_acceptcaps (GstBaseSink * sink, GstQuery * query)
if ((!framed && !parsed) || gst_audio_iec61937_frame_size (&spec) <= 0) if ((!framed && !parsed) || gst_audio_iec61937_frame_size (&spec) <= 0)
goto done; goto done;
} }
default:
break;
}
ret = TRUE; ret = TRUE;
done: done: