diff options
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2009-08-09 13:58:07 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2009-08-09 13:58:07 +0100 |
commit | 6df8fb76ef23939cf802ed022360e98083907755 (patch) | |
tree | 691aa8acb3ea099cc9d89e8fa978fa78e38b1b27 /sys | |
parent | 494555cecd707225977773799626e6cc2cb2ff88 (diff) |
osxaudiosrc: if max_channels == min_channels, use an int instead of an int range in the caps
Diffstat (limited to 'sys')
-rw-r--r-- | sys/osxaudio/gstosxaudiosrc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/osxaudio/gstosxaudiosrc.c b/sys/osxaudio/gstosxaudiosrc.c index 9acf4405..9df46dce 100644 --- a/sys/osxaudio/gstosxaudiosrc.c +++ b/sys/osxaudio/gstosxaudiosrc.c @@ -223,7 +223,6 @@ gst_osx_audio_src_get_caps (GstBaseSrc * src) GstOsxAudioSrc *osxsrc; GstPadTemplate *pad_template; GstCaps *caps; - GstStructure *structure; gint min, max; gstelement_class = GST_ELEMENT_GET_CLASS (src); @@ -247,8 +246,12 @@ gst_osx_audio_src_get_caps (GstBaseSrc * src) caps = gst_caps_copy (gst_pad_template_get_caps (pad_template)); - structure = gst_caps_get_structure (caps, 0); - gst_structure_set (structure, "channels", GST_TYPE_INT_RANGE, min, max, NULL); + if (min == max) { + gst_caps_set_simple (caps, "channels", G_TYPE_INT, max, NULL); + } else { + gst_caps_set_simple (caps, "channels", GST_TYPE_INT_RANGE, min, max, + NULL); + } return caps; } |