gboolean mute);
static gboolean gst_directsound_sink_get_mute (GstDirectSoundSink * sink);
+static gboolean gst_directsound_sink_is_spdif_format (GstDirectSoundSink * dsoundsink);
+
static GstStaticPadTemplate directsoundsink_sink_factory =
GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
goto done;
/* Make sure input is framed (one frame per buffer) and can be payloaded */
- switch (rbuf->spec.type) {
- case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_AC3:
+ if (gst_directsound_sink_is_spdif_format (dsink))
{
gboolean framed = FALSE, parsed = FALSE;
st = gst_caps_get_structure (caps, 0);
if ((!framed && !parsed) || gst_audio_iec61937_frame_size (&spec) <= 0)
goto done;
}
- default:{
- }
- }
ret = TRUE;
done:
return TRUE;
}
-static boolean
+static gboolean
gst_directsound_sink_is_spdif_format (GstDirectSoundSink * dsoundsink)
{
GstAudioRingBufferFormatType type;
static GstBuffer *
gst_directsound_sink_payload (GstAudioBaseSink * sink, GstBuffer * buf)
{
- switch (sink->ringbuffer->spec.type) {
- case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_AC3:
+ if (gst_directsound_sink_is_spdif_format ((GstDirectSoundSink *) sink))
{
gint framesize = gst_audio_iec61937_frame_size (&sink->ringbuffer->spec);
GstBuffer *out;
gst_buffer_unmap (buf, &infobuf);
return out;
}
-
- default:
+ else
return gst_buffer_ref (buf);
- }
}
static void