mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 08:11:16 +00:00
decklinkaudiosrc: Fix get_caps returning EMPTY
If get_caps is called before negotiation, channels_found will be 0 and therefore won't intersect with the template caps. https://bugzilla.gnome.org/show_bug.cgi?id=778028
This commit is contained in:
parent
718c4140fa
commit
21a9a89851
1 changed files with 11 additions and 3 deletions
|
@ -429,9 +429,17 @@ gst_decklink_audio_src_get_caps (GstBaseSrc * bsrc, GstCaps * filter)
|
||||||
GstCaps *channel_filter, *templ;
|
GstCaps *channel_filter, *templ;
|
||||||
|
|
||||||
templ = gst_pad_get_pad_template_caps (GST_BASE_SRC_PAD (bsrc));
|
templ = gst_pad_get_pad_template_caps (GST_BASE_SRC_PAD (bsrc));
|
||||||
channel_filter =
|
if (self->channels_found > 0) {
|
||||||
gst_caps_new_simple ("audio/x-raw", "channels", G_TYPE_INT,
|
channel_filter =
|
||||||
self->channels_found, NULL);
|
gst_caps_new_simple ("audio/x-raw", "channels", G_TYPE_INT,
|
||||||
|
self->channels_found, NULL);
|
||||||
|
} else if (self->channels > 0) {
|
||||||
|
channel_filter =
|
||||||
|
gst_caps_new_simple ("audio/x-raw", "channels", G_TYPE_INT,
|
||||||
|
self->channels, NULL);
|
||||||
|
} else {
|
||||||
|
channel_filter = gst_caps_new_empty_simple ("audio/x-raw");
|
||||||
|
}
|
||||||
caps = gst_caps_intersect (channel_filter, templ);
|
caps = gst_caps_intersect (channel_filter, templ);
|
||||||
gst_caps_unref (channel_filter);
|
gst_caps_unref (channel_filter);
|
||||||
gst_caps_unref (templ);
|
gst_caps_unref (templ);
|
||||||
|
|
Loading…
Reference in a new issue