mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 20:59:44 +00:00
ext/pulse/: The bytes_per_sample and silence_sample fields of the GstRingBufferSpec are already filled with the corre...
Original commit message from CVS: * ext/pulse/pulsesink.c: (gst_pulsesink_prepare): * ext/pulse/pulsesrc.c: (gst_pulsesrc_prepare): The bytes_per_sample and silence_sample fields of the GstRingBufferSpec are already filled with the correct values by gst_ring_buffer_parse_caps() so there's no need to set them again with wrong values.
This commit is contained in:
parent
25665a0df3
commit
cfc5ea685a
3 changed files with 16 additions and 14 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2008-08-18 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||||
|
|
||||||
|
* ext/pulse/pulsesink.c: (gst_pulsesink_prepare):
|
||||||
|
* ext/pulse/pulsesrc.c: (gst_pulsesrc_prepare):
|
||||||
|
The bytes_per_sample and silence_sample fields of the GstRingBufferSpec
|
||||||
|
are already filled with the correct values by
|
||||||
|
gst_ring_buffer_parse_caps() so there's no need to set them again
|
||||||
|
with wrong values.
|
||||||
|
|
||||||
2008-08-16 Edward Hervey <edward.hervey@collabora.co.uk>
|
2008-08-16 Edward Hervey <edward.hervey@collabora.co.uk>
|
||||||
|
|
||||||
* gst/avi/gstavidemux.c: (gst_avi_demux_read_subindexes_pull),
|
* gst/avi/gstavidemux.c: (gst_avi_demux_read_subindexes_pull),
|
||||||
|
|
|
@ -584,16 +584,14 @@ gst_pulsesink_prepare (GstAudioSink * asink, GstRingBufferSpec * spec)
|
||||||
if (!pulsesink->context
|
if (!pulsesink->context
|
||||||
|| pa_context_get_state (pulsesink->context) != PA_CONTEXT_READY) {
|
|| pa_context_get_state (pulsesink->context) != PA_CONTEXT_READY) {
|
||||||
GST_ELEMENT_ERROR (pulsesink, RESOURCE, FAILED, ("Bad context state: %s",
|
GST_ELEMENT_ERROR (pulsesink, RESOURCE, FAILED, ("Bad context state: %s",
|
||||||
pulsesink->
|
pulsesink->context ? pa_strerror (pa_context_errno (pulsesink->
|
||||||
context ? pa_strerror (pa_context_errno (pulsesink->context)) :
|
context)) : NULL), (NULL));
|
||||||
NULL), (NULL));
|
|
||||||
goto unlock_and_fail;
|
goto unlock_and_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(pulsesink->stream = pa_stream_new (pulsesink->context,
|
if (!(pulsesink->stream = pa_stream_new (pulsesink->context,
|
||||||
pulsesink->
|
pulsesink->stream_name ? pulsesink->
|
||||||
stream_name ? pulsesink->stream_name : "Playback Stream",
|
stream_name : "Playback Stream", &pulsesink->sample_spec,
|
||||||
&pulsesink->sample_spec,
|
|
||||||
gst_pulse_gst_to_channel_map (&channel_map, spec)))) {
|
gst_pulse_gst_to_channel_map (&channel_map, spec)))) {
|
||||||
GST_ELEMENT_ERROR (pulsesink, RESOURCE, FAILED,
|
GST_ELEMENT_ERROR (pulsesink, RESOURCE, FAILED,
|
||||||
("Failed to create stream: %s",
|
("Failed to create stream: %s",
|
||||||
|
@ -636,9 +634,6 @@ gst_pulsesink_prepare (GstAudioSink * asink, GstRingBufferSpec * spec)
|
||||||
|
|
||||||
pa_threaded_mainloop_unlock (pulsesink->mainloop);
|
pa_threaded_mainloop_unlock (pulsesink->mainloop);
|
||||||
|
|
||||||
spec->bytes_per_sample = pa_frame_size (&pulsesink->sample_spec);
|
|
||||||
memset (spec->silence_sample, 0, spec->bytes_per_sample);
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
gst_pulsesink_set_volume (pulsesink, pulsesink->volume);
|
gst_pulsesink_set_volume (pulsesink, pulsesink->volume);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -509,8 +509,9 @@ gst_pulsesrc_prepare (GstAudioSrc * asrc, GstRingBufferSpec * spec)
|
||||||
if (!pulsesrc->context
|
if (!pulsesrc->context
|
||||||
|| pa_context_get_state (pulsesrc->context) != PA_CONTEXT_READY) {
|
|| pa_context_get_state (pulsesrc->context) != PA_CONTEXT_READY) {
|
||||||
GST_ELEMENT_ERROR (pulsesrc, RESOURCE, FAILED, ("Bad context state: %s",
|
GST_ELEMENT_ERROR (pulsesrc, RESOURCE, FAILED, ("Bad context state: %s",
|
||||||
pulsesrc->context ? pa_strerror (pa_context_errno (pulsesrc->
|
pulsesrc->
|
||||||
context)) : NULL), (NULL));
|
context ? pa_strerror (pa_context_errno (pulsesrc->context)) :
|
||||||
|
NULL), (NULL));
|
||||||
goto unlock_and_fail;
|
goto unlock_and_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -554,9 +555,6 @@ gst_pulsesrc_prepare (GstAudioSrc * asrc, GstRingBufferSpec * spec)
|
||||||
|
|
||||||
pa_threaded_mainloop_unlock (pulsesrc->mainloop);
|
pa_threaded_mainloop_unlock (pulsesrc->mainloop);
|
||||||
|
|
||||||
spec->bytes_per_sample = pa_frame_size (&pulsesrc->sample_spec);
|
|
||||||
memset (spec->silence_sample, 0, spec->bytes_per_sample);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
unlock_and_fail:
|
unlock_and_fail:
|
||||||
|
|
Loading…
Reference in a new issue