ext/alsa/gstalsa.c: Don't omit the last (which incase of dmix is the only :) ) channel count. Don't set channels if <...

Original commit message from CVS:
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
Don't omit the last (which incase of dmix is the only :) )
channel count. Don't set channels if <= 2.
This commit is contained in:
Ronald S. Bultje 2004-11-26 11:47:24 +00:00
parent 0e8f1eb7a3
commit e71527d6d9
2 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2004-11-26 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
Don't omit the last (which incase of dmix is the only :) )
channel count. Don't set channels if <= 2.
2004-11-26 Christophe Fergeau <teuf@gnome.org>
* gst/playback/gstplaybin.c: (gen_video_element),

View file

@ -861,7 +861,7 @@ gst_alsa_get_caps (GstPad * pad)
min_channels, max_channels);
/* channel configuration */
for (n = min_channels; n < max_channels; n++) {
for (n = min_channels; n <= max_channels; n++) {
if (snd_pcm_hw_params_test_channels (this->handle, hw_params, n) == 0) {
GstStructure *str;
GstAudioChannelPosition pos[8] = {
@ -894,7 +894,9 @@ gst_alsa_get_caps (GstPad * pad)
if (pos[0] != GST_AUDIO_CHANNEL_POSITION_INVALID) {
str = gst_structure_copy (gst_caps_get_structure (caps, 0));
gst_structure_set (str, "channels", G_TYPE_INT, n, NULL);
gst_audio_set_channel_positions (str, pos);
if (n > 2) {
gst_audio_set_channel_positions (str, pos);
}
if (!ret) {
ret = gst_caps_new_empty ();
}