mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
osxaudiosrc: if max_channels == min_channels, use an int instead of an int range in the caps
This commit is contained in:
parent
494555cecd
commit
6df8fb76ef
1 changed files with 6 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue