osxaudiosink: channel-mask configuration fixes

Set channel-mask according to sink's layout in case of stereo layout.
Also initialize and reset the mask when an unrecognized channel is detected.

https://bugzilla.gnome.org/show_bug.cgi?id=698224
This commit is contained in:
Philippe Normand 2013-04-17 21:05:14 +02:00 committed by Sebastian Dröge
parent b5a9ed20e1
commit d352201a34

View file

@ -537,7 +537,7 @@ gst_osx_audio_sink_allowed_caps (GstOsxAudioSink * osxsink)
GstElementClass *element_class;
GstPadTemplate *pad_template;
GstCaps *caps, *in_caps;
guint64 channel_mask;
guint64 channel_mask = 0;
GstAudioChannelPosition *pos = osxsink->channel_positions;
/* First collect info about the HW capabilites and preferences */
@ -567,6 +567,8 @@ gst_osx_audio_sink_allowed_caps (GstOsxAudioSink * osxsink)
case 2:
pos[0] = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT;
pos[1] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT;
channel_mask |= GST_AUDIO_CHANNEL_POSITION_MASK (FRONT_LEFT);
channel_mask |= GST_AUDIO_CHANNEL_POSITION_MASK (FRONT_RIGHT);
break;
default:
channels = MIN (layout->mNumberChannelDescriptions,
@ -612,6 +614,7 @@ gst_osx_audio_sink_allowed_caps (GstOsxAudioSink * osxsink)
default:
GST_WARNING_OBJECT (osxsink, "unrecognized channel: %d",
(int) layout->mChannelDescriptions[i].mChannelLabel);
channel_mask = 0;
channels = 2;
break;
}