mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
dshowsrcwrapper: Fixed null caps comparison
https://bugzilla.gnome.org/show_bug.cgi?id=741086
This commit is contained in:
parent
c306e0dfa7
commit
d627f4b93b
2 changed files with 10 additions and 7 deletions
|
@ -454,12 +454,13 @@ gst_dshowaudiosrc_prepare (GstAudioSrc * asrc, GstAudioRingBufferSpec * spec)
|
||||||
GstDshowAudioSrc *src = GST_DSHOWAUDIOSRC (asrc);
|
GstDshowAudioSrc *src = GST_DSHOWAUDIOSRC (asrc);
|
||||||
GstCaps *current_caps = gst_pad_get_current_caps (GST_BASE_SRC_PAD (asrc));
|
GstCaps *current_caps = gst_pad_get_current_caps (GST_BASE_SRC_PAD (asrc));
|
||||||
|
|
||||||
if (gst_caps_is_equal (spec->caps, current_caps)) {
|
if (current_caps) {
|
||||||
|
if (gst_caps_is_equal (spec->caps, current_caps)) {
|
||||||
|
gst_caps_unref (current_caps);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
gst_caps_unref (current_caps);
|
gst_caps_unref (current_caps);
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
gst_caps_unref (current_caps);
|
|
||||||
|
|
||||||
/* In 1.0, prepare() seems to be called in the PLAYING state. Most
|
/* In 1.0, prepare() seems to be called in the PLAYING state. Most
|
||||||
of the time you can't do much on a running graph. */
|
of the time you can't do much on a running graph. */
|
||||||
|
|
||||||
|
|
|
@ -578,11 +578,13 @@ gst_dshowvideosrc_set_caps (GstBaseSrc * bsrc, GstCaps * caps)
|
||||||
GstStructure *s = gst_caps_get_structure (caps, 0);
|
GstStructure *s = gst_caps_get_structure (caps, 0);
|
||||||
GstCaps *current_caps = gst_pad_get_current_caps (GST_BASE_SRC_PAD (bsrc));
|
GstCaps *current_caps = gst_pad_get_current_caps (GST_BASE_SRC_PAD (bsrc));
|
||||||
|
|
||||||
if (gst_caps_is_equal (caps, current_caps)) {
|
if (current_caps) {
|
||||||
|
if (gst_caps_is_equal (caps, current_caps)) {
|
||||||
|
gst_caps_unref (current_caps);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
gst_caps_unref (current_caps);
|
gst_caps_unref (current_caps);
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
gst_caps_unref (current_caps);
|
|
||||||
|
|
||||||
/* Same remark as in gstdshowaudiosrc. */
|
/* Same remark as in gstdshowaudiosrc. */
|
||||||
gboolean was_running = src->is_running;
|
gboolean was_running = src->is_running;
|
||||||
|
|
Loading…
Reference in a new issue