ext/alsa/gstalsa.c: Fix remaining caps handling errors due to CAPS merge.
Original commit message from CVS: 2003-12-22 Benjamin Otte <in7y118@public.uni-hamburg.de> * ext/alsa/gstalsa.c: (gst_alsa_get_caps), (gst_alsa_link): Fix remaining caps handling errors due to CAPS merge.
This commit is contained in:
parent
d3c942b2d1
commit
d71b6b803a
@ -1,3 +1,8 @@
|
|||||||
|
2003-12-22 Benjamin Otte <in7y118@public.uni-hamburg.de>
|
||||||
|
|
||||||
|
* ext/alsa/gstalsa.c: (gst_alsa_get_caps), (gst_alsa_link):
|
||||||
|
Fix remaining caps handling errors due to CAPS merge.
|
||||||
|
|
||||||
2003-12-22 Benjamin Otte <in7y118@public.uni-hamburg.de>
|
2003-12-22 Benjamin Otte <in7y118@public.uni-hamburg.de>
|
||||||
|
|
||||||
* ext/faad/gstfaad.c: (gst_faad_base_init), (gst_faad_init),
|
* ext/faad/gstfaad.c: (gst_faad_base_init), (gst_faad_init),
|
||||||
|
@ -557,7 +557,7 @@ gst_alsa_get_caps (GstPad *pad)
|
|||||||
this = GST_ALSA (gst_pad_get_parent (pad));
|
this = GST_ALSA (gst_pad_get_parent (pad));
|
||||||
|
|
||||||
if (!GST_FLAG_IS_SET (this, GST_ALSA_OPEN))
|
if (!GST_FLAG_IS_SET (this, GST_ALSA_OPEN))
|
||||||
return NULL;
|
return gst_caps_copy (GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (pad)));
|
||||||
|
|
||||||
snd_pcm_hw_params_alloca (&hw_params);
|
snd_pcm_hw_params_alloca (&hw_params);
|
||||||
ERROR_CHECK (snd_pcm_hw_params_any (this->handle, hw_params),
|
ERROR_CHECK (snd_pcm_hw_params_any (this->handle, hw_params),
|
||||||
@ -591,13 +591,25 @@ gst_alsa_get_caps (GstPad *pad)
|
|||||||
if (caps != NULL) {
|
if (caps != NULL) {
|
||||||
g_assert (gst_caps_get_size (caps) == 1);
|
g_assert (gst_caps_get_size (caps) == 1);
|
||||||
add_channels (gst_caps_get_structure (caps, 0), min_rate, max_rate, min_channels, max_channels);
|
add_channels (gst_caps_get_structure (caps, 0), min_rate, max_rate, min_channels, max_channels);
|
||||||
|
if (ret) {
|
||||||
gst_caps_append (ret, caps);
|
gst_caps_append (ret, caps);
|
||||||
|
} else {
|
||||||
|
ret = caps;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ret == NULL) {
|
||||||
|
GST_WARNING_OBJECT (this, "no supported caps found, returning empty caps");
|
||||||
|
return gst_caps_new_empty ();
|
||||||
|
} else {
|
||||||
|
G_GNUC_UNUSED gchar *str = gst_caps_to_string (ret);
|
||||||
|
GST_LOG_OBJECT (this, "get_caps returns %s", str);
|
||||||
|
g_free (str);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Negotiates the caps */
|
/* Negotiates the caps */
|
||||||
GstPadLinkReturn
|
GstPadLinkReturn
|
||||||
@ -658,6 +670,7 @@ gst_alsa_link (GstPad *pad, const GstCaps *caps)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GST_FLAG_UNSET (this, GST_ALSA_CAPS_NEGO);
|
GST_FLAG_UNSET (this, GST_ALSA_CAPS_NEGO);
|
||||||
|
|
||||||
@ -669,7 +682,6 @@ gst_alsa_link (GstPad *pad, const GstCaps *caps)
|
|||||||
gst_element_error (GST_ELEMENT (this), "Probed format doesn't work");
|
gst_element_error (GST_ELEMENT (this), "Probed format doesn't work");
|
||||||
return GST_PAD_LINK_REFUSED;
|
return GST_PAD_LINK_REFUSED;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return GST_PAD_LINK_OK;
|
return GST_PAD_LINK_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user