mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
ext/alsa/: Don't use snd_pcm_sw_params_set_xfer_align() if we're compiling against libasound >= 1.0.16, since it's be...
Original commit message from CVS: * ext/alsa/gstalsa.h: (GST_CHECK_ALSA_VERSION): * ext/alsa/gstalsasink.c: (set_swparams): * ext/alsa/gstalsasrc.c: (set_swparams), (gst_alsasrc_open): Don't use snd_pcm_sw_params_set_xfer_align() if we're compiling against libasound >= 1.0.16, since it's been deprecated in 0.10.16, and alignment is always 1 then, apparently. (#512899)
This commit is contained in:
parent
1d9e1d6a3d
commit
5f1cc19bef
4 changed files with 29 additions and 0 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2008-02-11 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
* ext/alsa/gstalsa.h: (GST_CHECK_ALSA_VERSION):
|
||||||
|
* ext/alsa/gstalsasink.c: (set_swparams):
|
||||||
|
* ext/alsa/gstalsasrc.c: (set_swparams), (gst_alsasrc_open):
|
||||||
|
Don't use snd_pcm_sw_params_set_xfer_align() if we're compiling
|
||||||
|
against libasound >= 1.0.16, since it's been deprecated in
|
||||||
|
0.10.16, and alignment is always 1 then, apparently. (#512899)
|
||||||
|
|
||||||
2008-02-11 Tim-Philipp Müller <tim at centricular dot net>
|
2008-02-11 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* gst/playback/gstplaybin.c: (gen_audio_element):
|
* gst/playback/gstplaybin.c: (gen_audio_element):
|
||||||
|
|
|
@ -32,6 +32,12 @@
|
||||||
#include <alsa/error.h>
|
#include <alsa/error.h>
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
#define GST_CHECK_ALSA_VERSION(major,minor,micro) \
|
||||||
|
(SND_LIB_MAJOR > (major) || \
|
||||||
|
(SND_LIB_MAJOR == (major) && SND_LIB_MINOR > (minor)) || \
|
||||||
|
(SND_LIB_MAJOR == (major) && SND_LIB_MINOR == (minor) && \
|
||||||
|
SND_LIB_SUBMINOR >= (micro)))
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (alsa_debug);
|
GST_DEBUG_CATEGORY_EXTERN (alsa_debug);
|
||||||
#define GST_CAT_DEFAULT alsa_debug
|
#define GST_CAT_DEFAULT alsa_debug
|
||||||
|
|
||||||
|
|
|
@ -523,8 +523,13 @@ set_swparams (GstAlsaSink * alsa)
|
||||||
/* allow the transfer when at least period_size samples can be processed */
|
/* allow the transfer when at least period_size samples can be processed */
|
||||||
CHECK (snd_pcm_sw_params_set_avail_min (alsa->handle, params,
|
CHECK (snd_pcm_sw_params_set_avail_min (alsa->handle, params,
|
||||||
alsa->period_size), set_avail);
|
alsa->period_size), set_avail);
|
||||||
|
|
||||||
|
#if GST_CHECK_ALSA_VERSION(1,0,16)
|
||||||
|
/* snd_pcm_sw_params_set_xfer_align() is deprecated, alignment is always 1 */
|
||||||
|
#else
|
||||||
/* align all transfers to 1 sample */
|
/* align all transfers to 1 sample */
|
||||||
CHECK (snd_pcm_sw_params_set_xfer_align (alsa->handle, params, 1), set_align);
|
CHECK (snd_pcm_sw_params_set_xfer_align (alsa->handle, params, 1), set_align);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* write the parameters to the playback device */
|
/* write the parameters to the playback device */
|
||||||
CHECK (snd_pcm_sw_params (alsa->handle, params), set_sw_params);
|
CHECK (snd_pcm_sw_params (alsa->handle, params), set_sw_params);
|
||||||
|
@ -556,6 +561,7 @@ set_avail:
|
||||||
snd_pcm_sw_params_free (params);
|
snd_pcm_sw_params_free (params);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
#if !GST_CHECK_ALSA_VERSION(1,0,16)
|
||||||
set_align:
|
set_align:
|
||||||
{
|
{
|
||||||
GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
|
GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
|
||||||
|
@ -563,6 +569,7 @@ set_align:
|
||||||
snd_pcm_sw_params_free (params);
|
snd_pcm_sw_params_free (params);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
set_sw_params:
|
set_sw_params:
|
||||||
{
|
{
|
||||||
GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
|
GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
|
||||||
|
|
|
@ -502,8 +502,13 @@ set_swparams (GstAlsaSrc * alsa)
|
||||||
/* start the transfer on first read */
|
/* start the transfer on first read */
|
||||||
CHECK (snd_pcm_sw_params_set_start_threshold (alsa->handle, params,
|
CHECK (snd_pcm_sw_params_set_start_threshold (alsa->handle, params,
|
||||||
0), start_threshold);
|
0), start_threshold);
|
||||||
|
|
||||||
|
#if GST_CHECK_ALSA_VERSION(1,0,16)
|
||||||
|
/* snd_pcm_sw_params_set_xfer_align() is deprecated, alignment is always 1 */
|
||||||
|
#else
|
||||||
/* align all transfers to 1 sample */
|
/* align all transfers to 1 sample */
|
||||||
CHECK (snd_pcm_sw_params_set_xfer_align (alsa->handle, params, 1), set_align);
|
CHECK (snd_pcm_sw_params_set_xfer_align (alsa->handle, params, 1), set_align);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* write the parameters to the recording device */
|
/* write the parameters to the recording device */
|
||||||
CHECK (snd_pcm_sw_params (alsa->handle, params), set_sw_params);
|
CHECK (snd_pcm_sw_params (alsa->handle, params), set_sw_params);
|
||||||
|
@ -535,6 +540,7 @@ set_avail:
|
||||||
snd_pcm_sw_params_free (params);
|
snd_pcm_sw_params_free (params);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
#if !GST_CHECK_ALSA_VERSION(1,0,16)
|
||||||
set_align:
|
set_align:
|
||||||
{
|
{
|
||||||
GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
|
GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
|
||||||
|
@ -542,6 +548,7 @@ set_align:
|
||||||
snd_pcm_sw_params_free (params);
|
snd_pcm_sw_params_free (params);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
set_sw_params:
|
set_sw_params:
|
||||||
{
|
{
|
||||||
GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
|
GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL),
|
||||||
|
|
Loading…
Reference in a new issue