#else
pa_sample_spec sample_spec;
#endif
+ gboolean is_pcm;
void *m_data;
size_t m_towrite;
#else
pa_sample_spec_init (&pbuf->sample_spec);
#endif
+ pbuf->is_pcm = FALSE;
pbuf->m_data = NULL;
pbuf->m_towrite = 0;
pa_format_info_free (pbuf->format);
pbuf->format = NULL;
pbuf->channels = 0;
+ pbuf->is_pcm = FALSE;
}
#endif
continue;
#ifdef HAVE_PULSE_1_0
- if (psink->device && pa_format_info_is_pcm (pbuf->format) &&
+ if (psink->device && pbuf->is_pcm &&
!g_str_equal (psink->device,
pa_stream_get_device_name (pbuf->stream))) {
/* Underlying sink changed. And this is not a passthrough stream. Let's
#ifdef HAVE_PULSE_1_0
if (!gst_pulse_fill_format_info (spec, &pbuf->format, &pbuf->channels))
goto invalid_spec;
+ pbuf->is_pcm = pa_format_info_is_pcm (pbuf->format);
#else
if (!gst_pulse_fill_sample_spec (spec, &pbuf->sample_spec))
goto invalid_spec;
+ pbuf->is_pcm = TRUE;
#endif
pa_threaded_mainloop_lock (mainloop);
/* initialize the channel map */
#ifdef HAVE_PULSE_1_0
- if (pa_format_info_is_pcm (pbuf->format) &&
- gst_pulse_gst_to_channel_map (&channel_map, spec))
+ if (pbuf->is_pcm && gst_pulse_gst_to_channel_map (&channel_map, spec))
pa_format_info_set_channel_map (pbuf->format, &channel_map);
#else
gst_pulse_gst_to_channel_map (&channel_map, spec);
GST_LOG_OBJECT (psink, "have volume of %f", psink->volume);
pv = &v;
#ifdef HAVE_PULSE_1_0
- if (pa_format_info_is_pcm (pbuf->format))
+ if (pbuf->is_pcm)
gst_pulse_cvolume_from_linear (pv, pbuf->channels, psink->volume);
else {
GST_DEBUG_OBJECT (psink, "passthrough stream, not setting volume");
/* EOS needs running clock */
if (GST_BASE_SINK_CAST (psink)->eos ||
- g_atomic_int_get (&GST_BASE_AUDIO_SINK (psink)->abidata.ABI.
- eos_rendering))
+ g_atomic_int_get (&GST_BASE_AUDIO_SINK (psink)->abidata.
+ ABI.eos_rendering))
gst_pulsering_set_corked (pbuf, FALSE, FALSE);
pa_threaded_mainloop_unlock (mainloop);
#ifdef HAVE_PULSE_1_0
/* No trick modes for passthrough streams */
- if (G_UNLIKELY (inr != outr || reverse)) {
+ if (G_UNLIKELY (!pbuf->is_pcm && (inr != outr || reverse))) {
GST_WARNING_OBJECT (psink, "Passthrough stream can't run in trick mode");
goto unlock_and_fail;
}
goto no_index;
#ifdef HAVE_PULSE_1_0
- if (pa_format_info_is_pcm (pbuf->format))
+ if (pbuf->is_pcm)
gst_pulse_cvolume_from_linear (&v, pbuf->channels, volume);
else
/* FIXME: this will eventually be superceded by checks to see if the volume